-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"koala": minor | ||
--- | ||
|
||
added help command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,50 @@ | ||
import { env } from "@/env"; | ||
import { type CommandInteraction } from "discord.js"; | ||
import { EmbedBuilder, type CommandInteraction } from "discord.js"; | ||
import { Discord, Slash } from "discordx"; | ||
|
||
function getInviteLink(botId: string) { | ||
return ( | ||
env.CUSTOM_INVITE_LINK || | ||
`https://discord.com/oauth2/authorize?client_id=${botId}&permissions=${env.PERMISSIONS_INTEGER}&integration_type=0&scope=applications.commands+bot` | ||
); | ||
} | ||
|
||
@Discord() | ||
export class MiscCommands { | ||
@Slash({ description: "Get an invite link to the bot" }) | ||
invite(interaction: CommandInteraction, client: KoalaClient): void { | ||
const url = | ||
env.CUSTOM_INVITE_LINK || | ||
`https://discord.com/oauth2/authorize?client_id=${client.user?.id}&permissions=${env.PERMISSIONS_INTEGER}&integration_type=0&scope=applications.commands+bot`; | ||
const url = getInviteLink(client.user!.id); | ||
|
||
interaction.reply({ | ||
content: `[Invite link](${url})`, | ||
ephemeral: true, | ||
}); | ||
} | ||
|
||
@Slash({ description: "Feeling lost? Get to know the basics!" }) | ||
help(interaction: CommandInteraction, client: KoalaClient): void { | ||
const links = [`[Invite me](${getInviteLink(client.user!.id)})`]; | ||
|
||
if (env.SUPPORT_SERVER_LINK) { | ||
links.push(`[Support Server](${env.SUPPORT_SERVER_LINK})`); | ||
} | ||
|
||
const helpEmbed = new EmbedBuilder() | ||
.setColor(0xb46547) | ||
.setTitle("Help") | ||
.setDescription( | ||
`Koala is a voice utility-focused bot that enhances your discord experience by announcing users as they join the channel and much more | ||
\nUse the \`/settings announce\` command and its subcommands to customize which channels Koala announces in | ||
\nBy default, announcements are enabled for every channel, so you're ready to go right out of the box!\n`, | ||
) | ||
.addFields({ | ||
name: "Links", | ||
value: links.join(" • "), | ||
}); | ||
|
||
interaction.reply({ | ||
embeds: [helpEmbed], | ||
ephemeral: true, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters