Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for user-installable apps #228

Merged
merged 9 commits into from
Nov 2, 2024
Prev Previous commit
Next Next commit
fix: a temporary solution to the type error
Signed-off-by: Seren_Modz 21 <seren@kings-world.net>
  • Loading branch information
SerenModz21 committed Nov 2, 2024
commit 7e9cbe69dfa42cf0797a5e0ea04d7e4ce4d515d8
4 changes: 4 additions & 0 deletions examples/with-typescript-starter/src/commands/ping.ts
Original file line number Diff line number Diff line change
@@ -58,6 +58,10 @@ export class UserCommand extends Command {
}

private async sendPing(interactionOrMessage: Message | Command.ChatInputCommandInteraction | Command.ContextMenuCommandInteraction) {
// TODO: replace with BaseChannel#isSendable once discord.js releases a new version
// PR for reference: https://github.com/discordjs/discord.js/pull/10482
if (interactionOrMessage.channel && !('send' in interactionOrMessage.channel)) return;

const pingMessage =
interactionOrMessage instanceof Message
? await interactionOrMessage.channel.send({ content: 'Ping?' }) // TODO: fix typing issue with group dm channels