From dcb4a990f13401b374f683ce70e2869fef3cdb72 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sun, 3 Apr 2022 19:48:53 +0100 Subject: [PATCH] Add an invite command. --- bot/src/slashCommands/commands.ts | 2 ++ bot/src/slashCommands/commands/invite.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 bot/src/slashCommands/commands/invite.ts diff --git a/bot/src/slashCommands/commands.ts b/bot/src/slashCommands/commands.ts index 2d7090ebd..a830dd5b9 100644 --- a/bot/src/slashCommands/commands.ts +++ b/bot/src/slashCommands/commands.ts @@ -7,6 +7,7 @@ import profile from "./commands/profile"; import quote from "./commands/quote"; import sync from "./commands/sync"; import whois from "./commands/whois"; +import invite from "./commands/invite"; import { SlashCommand } from "./types"; export const SLASH_COMMANDS: Map = new Map( @@ -28,5 +29,6 @@ if (ServerConfig.type !== "btchi") { // btchi or omni specific commands if (ServerConfig.type !== "ktchi") { + SLASH_COMMANDS.set("invite", invite); // None. Yet! } diff --git a/bot/src/slashCommands/commands/invite.ts b/bot/src/slashCommands/commands/invite.ts new file mode 100644 index 000000000..9c86bdbe0 --- /dev/null +++ b/bot/src/slashCommands/commands/invite.ts @@ -0,0 +1,16 @@ +import { SlashCommandBuilder } from "@discordjs/builders"; +import { client } from "../../main"; +import { SlashCommand } from "../types"; + +const command: SlashCommand = { + info: new SlashCommandBuilder() + .setName("invite") + .setDescription("Invite this bot to another server.") + .toJSON(), + exec: () => `To invite me into another server, use this link: +https://discord.com/api/oauth2/authorize?client_id=${ + client.application!.id + }&permissions=0&scope=bot%20applications.commands`, +}; + +export default command;