Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
77a7cfa
initial stuff
not-a-cowfr May 21, 2025
eec47af
some changes agi told me to make
not-a-cowfr May 22, 2025
9fe5d7f
add commands.md entries
not-a-cowfr May 22, 2025
e609e7d
lint
not-a-cowfr May 22, 2025
09c4bc6
fix todo comment
not-a-cowfr May 22, 2025
0dcce95
move stuff to npm package
not-a-cowfr May 22, 2025
06c4a37
crop autocomplete
not-a-cowfr May 22, 2025
8de8d1c
fix search command
not-a-cowfr May 22, 2025
f9f4a2c
use components instead of params
not-a-cowfr May 22, 2025
e635042
remove unused import
not-a-cowfr May 22, 2025
9a8c847
add main content embed
not-a-cowfr May 22, 2025
ac5623f
sepereate the 2 components
not-a-cowfr May 22, 2025
0f4f304
formatting
not-a-cowfr May 22, 2025
d0d9052
add movement calculator and lane time
not-a-cowfr May 22, 2025
1e71fce
account for holding w
not-a-cowfr May 22, 2025
477343c
fix search command description
not-a-cowfr May 27, 2025
b8a538b
Merge branch 'master' of https://github.com/EliteFarmers/Bot into far…
not-a-cowfr Jun 2, 2025
4fff6ba
stuff
not-a-cowfr Jun 4, 2025
7b90ea4
uncle bob martin has a gun to my head
not-a-cowfr Jun 4, 2025
6782ef5
use EliteContainer
not-a-cowfr Jun 4, 2025
8ff293e
add footer
not-a-cowfr Jun 4, 2025
d7cd22f
format
not-a-cowfr Jun 4, 2025
053fba9
remove params
not-a-cowfr Jun 4, 2025
4b6f36c
farm search command
not-a-cowfr Jun 4, 2025
3e33ba6
fix title
not-a-cowfr Jun 4, 2025
5617f9d
idk
not-a-cowfr Jun 4, 2025
a14d35f
format
not-a-cowfr Jun 4, 2025
f8009a3
refactor
not-a-cowfr Jun 5, 2025
43964f8
add button for search command top open info command
not-a-cowfr Jun 5, 2025
967b2c0
not that important anyway
not-a-cowfr Jun 5, 2025
b851242
refactor
not-a-cowfr Jun 5, 2025
629b6ef
shrug
not-a-cowfr Jun 21, 2025
35f597b
Merge branch 'master' of https://github.com/EliteFarmers/Bot into far…
not-a-cowfr Jun 21, 2025
92e728a
Support autocomplete in subcommands
ptlthg Jun 21, 2025
14ab0f7
format
not-a-cowfr Jun 21, 2025
6e006ca
fix seperator
not-a-cowfr Jun 21, 2025
c45997c
fix reply
not-a-cowfr Jun 21, 2025
794e952
fix authors list
not-a-cowfr Jun 21, 2025
da42483
bold stuff
not-a-cowfr Jun 21, 2025
054bbb9
add no design error embed
not-a-cowfr Jun 21, 2025
f6cf226
fix resources section
not-a-cowfr Jun 21, 2025
4ea151a
fix farm search buttons
not-a-cowfr Jun 21, 2025
1d5d266
fix farm search buttons
not-a-cowfr Jun 21, 2025
a9cb298
Merge branch 'farm-info-command' of https://github.com/not-a-cowfr/bo…
not-a-cowfr Jun 21, 2025
1ca6e01
remove depth strider
not-a-cowfr Jun 21, 2025
65faee0
remove keys sued, hide depth strider if level isnt speciified
not-a-cowfr Jun 21, 2025
5cbb3ea
command group description
not-a-cowfr Jun 21, 2025
8ec27e2
begin button/menu collector stuff
not-a-cowfr Jun 21, 2025
ed3b7e6
fix design being undefined
not-a-cowfr Jun 21, 2025
a913e5a
update embed for direction
not-a-cowfr Jun 21, 2025
80ec63c
refactor components and make settigns work
not-a-cowfr Jun 21, 2025
042ac12
lint
not-a-cowfr Jun 21, 2025
4a5d84f
fix soul sand speeds
not-a-cowfr Jun 21, 2025
0cbac1b
make farm settings command based rather than global
not-a-cowfr Jun 21, 2025
a1a2ebf
update imports for docker
not-a-cowfr Jun 22, 2025
d6e882e
update variable names
not-a-cowfr Jun 22, 2025
d51ebc8
add replaced by section
not-a-cowfr Jun 22, 2025
625b48a
add notes section
not-a-cowfr Jun 22, 2025
86b75b2
fix lane time
not-a-cowfr Jun 22, 2025
49bbd88
add bullet points for notes
not-a-cowfr Jun 22, 2025
c8ce5b9
remove footer on settings component
not-a-cowfr Jun 22, 2025
5c5c85e
update farming-weight
not-a-cowfr Jun 22, 2025
6d333c2
fix buttons/menu interaction
not-a-cowfr Jun 22, 2025
63962bc
Improve commands a bit
ptlthg Jul 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@ Link your Minecraft account so you no longer need to specify your player name! I

<img src="https://github.com/user-attachments/assets/c0296ab1-85cc-4980-ab0a-91533cad8a2e" alt="verify" style="width:500px;"/>

---
### /farm info
Get info on a specific farm design including, angles, speeds, tutorials and more.

**Usage:** `/farm info` \
`[design]: <design name>`

<img src="" alt="farm info" style="width:500px;"/>

---
### /farm search
Search for farm designs for a specific crop.

**Usage:** `/farm search` \
`[crop]: <crop>`

<img src="" alt="farm search" style="width:500px;"/>

## Info Commands

### /info
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"$schema": "https://biomejs.dev/schemas/2.0.2/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": {
"ignoreUnknown": false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"cron": "^3.5.0",
"date-fns": "^4.1.0",
"discord.js": "^14.20.0",
"farming-weight": "^0.9.4",
"farming-weight": "^0.9.5",
"openapi-fetch": "^0.14.0",
"redis": "^4.7.1",
"utf-8-validate": "^6.0.5",
Expand Down
29 changes: 29 additions & 0 deletions src/autocomplete/crops.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { EliteSlashCommandOption, SlashCommandOptionType } from 'classes/commands/options.js';
import { CROP_ARRAY } from 'classes/Util.js';
import { AutocompleteInteraction } from 'discord.js';
import { getCropDisplayName } from 'farming-weight';

export const eliteCropOption: EliteSlashCommandOption = {
name: 'crop',
description: 'The crop to get results for.',
type: SlashCommandOptionType.String,
required: true,
autocomplete,
};

export async function autocomplete(interaction: AutocompleteInteraction) {
if (interaction.responded) return;

const option = interaction.options.getFocused(true);
const options = CROP_ARRAY.map((v, i) => ({
name: getCropDisplayName(v),
value: i.toString(),
}));
if (!options) return;

const input = option.value.toLowerCase();

const filtered = options.filter((opt) => opt.name.toLowerCase().startsWith(input));

await interaction.respond(filtered);
}
38 changes: 38 additions & 0 deletions src/classes/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ButtonStyle,
ContainerBuilder,
Interaction,
MediaGalleryItemBuilder,
SectionBuilder,
SeparatorSpacingSize,
TextDisplayBuilder,
Expand Down Expand Up @@ -66,6 +67,30 @@ export class EliteContainer extends ContainerBuilder {
return this;
}

addImage(url: string, altText?: string) {
const item = new MediaGalleryItemBuilder().setURL(url);

if (altText) {
item.setDescription(altText);
}

this.addMediaGalleryComponents((media) => media.addItems(item));
return this;
}

addImages(images: { url: string; altText?: string }[]) {
const items = images.map((image) => {
const item = new MediaGalleryItemBuilder().setURL(image.url);
if (image.altText) {
item.setDescription(image.altText);
}
return item;
});

this.addMediaGalleryComponents((media) => media.addItems(...items));
return this;
}

addFooter(separator = true, backButton = '') {
if (separator) {
this.addSeparator();
Expand Down Expand Up @@ -109,6 +134,19 @@ export class EliteContainer extends ContainerBuilder {
return this;
}

addImageSection(url: string, ...textComponents: string[]) {
const section = new SectionBuilder().setId(10000 + Math.floor(Math.random() * 90000));

if (textComponents.length > 0) {
section.addTextDisplayComponents(...textComponents.map((text) => new TextDisplayBuilder().setContent(text)));
}

section.setThumbnailAccessory((a) => a.setURL(url));

this.addSectionComponents(section);
return this;
}

addCollapsible({ collapsed, expanded, opened, radio, header }: CollapsibleSectionData) {
const sectionId = 10000 + Math.floor(Math.random() * 90000);
const data = {
Expand Down
11 changes: 11 additions & 0 deletions src/commands/farm/command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { CommandAccess, CommandGroup, CommandType } from '../../classes/commands/index.js';

const command = new CommandGroup({
name: 'farm',
description: 'Commands to view farm designs',
execute: () => undefined,
access: CommandAccess.Everywhere,
type: CommandType.Group,
});

export default command;
Loading