-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make ephemeral responses work properly
- Loading branch information
1 parent
0802dc2
commit f923485
Showing
4 changed files
with
74 additions
and
17 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 @@ | ||
--- | ||
"@buape/carbon": patch | ||
--- | ||
|
||
fix: make ephemeral responses work properly |
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,35 @@ | ||
import { | ||
Command, | ||
type CommandInteraction, | ||
CommandWithSubcommands | ||
} from "@buape/carbon" | ||
|
||
export default class EphemeralCommand extends CommandWithSubcommands { | ||
name = "ephemeral" | ||
description = "Ephemeral test" | ||
ephemeral = true | ||
|
||
subcommands = [new EphemeralNoDefer(), new EphemeralDefer()] | ||
} | ||
|
||
class EphemeralNoDefer extends Command { | ||
name = "no-defer" | ||
description = "Ephemeral test" | ||
ephemeral = true | ||
defer = false | ||
|
||
async run(interaction: CommandInteraction): Promise<void> { | ||
return interaction.reply({ content: "Ephemeral no defer" }) | ||
} | ||
} | ||
|
||
export class EphemeralDefer extends Command { | ||
name = "defer" | ||
description = "Ephemeral test" | ||
ephemeral = true | ||
defer = true | ||
|
||
async run(interaction: CommandInteraction): Promise<void> { | ||
return interaction.reply({ content: "Ephemeral defer" }) | ||
} | ||
} |
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