Thanks to Boreas hypixel guild for helping with this project :)
This a Typescript rewrite of SealBot by @BamBoozledMC that focuses on ease of modification and aims to be as modular as possible. You can try this bot in action in Boreas.
$ npm install
$ yarn build
$ yarn start
$ npm install --sav-dev
Running the bot in developer makes the bot refresh after you make changes to files.
$ yarn dev
-
Create a new file in discordCommands folder (i.e. ping.ts)
-
Put a template inside the file you've just created:
import { SlashCommandBuilder } from "@discordjs/builders"; import {CommandInteraction} from "discord.js"; export const data = new SlashCommandBuilder() .setName("command_name") // i.e. .setName("ping") will make it a /ping command .setDescription("command_description"); // i.e. .setDescription("allows you see the bot's latency"); export async function execute(interaction: CommandInteraction) { return interaction.reply("reply_text"); // i.e. return interaction.reply("pong!"); }
-
Add the command into discordCommands/index.ts
echo '\nexport * as command_name from "./command_file_name"' >> discordCommands/index.ts
For example:
echo '\nexport * as help from "./ping" >> discordCommands/ping.ts'
-
Register the new command
yarn deploy:commands
-
Create a new file in minecraftCommands folder (i.e. ping.ts)
-
Put a template inside the file you've just created:
import { sendToMinecraft } from "../MinecraftManager"; export function execute(username: string, args: Array<string>): void { sendToMinecraft("text you want to send to minecraft"); // i.e. sendToMinecraft("pong"); }
-
Add the command into minecraftCommands/index.ts
echo '\nexport * as command_name from "./command_file_name"'
For example:
echo '\nexport * as ping from "./ping"'