-
-
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.
* feat: command permissions * Suggested changes
- Loading branch information
1 parent
4b8d474
commit 29c323c
Showing
8 changed files
with
58 additions
and
3 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": minor | ||
--- | ||
|
||
feat: command permissions |
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,11 @@ | ||
import { Command, type CommandInteraction, Permission } from "@buape/carbon" | ||
|
||
export default class PermissionCommand extends Command { | ||
name = "manage_server" | ||
description = "You need the manage server permission to see this command" | ||
permission = Permission.ManageGuild | ||
|
||
async run(interaction: CommandInteraction): Promise<void> { | ||
interaction.reply("You can see this 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Command, type CommandInteraction, Permission } from "@buape/carbon" | ||
|
||
export default class PermissionCommand extends Command { | ||
name = "manage_server" | ||
description = "You need the manage server permission to see this command" | ||
permission = Permission.ManageGuild | ||
|
||
async run(interaction: CommandInteraction): Promise<void> { | ||
interaction.reply("You can see this 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
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 |
---|---|---|
|
@@ -37,3 +37,5 @@ export type MessagePayload = | |
tts?: boolean | ||
} | ||
| string | ||
|
||
export type ArrayOrSingle<T> = T | T[] |