-
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.
feat: split files and register guild-specific commands
- Loading branch information
Showing
2 changed files
with
86 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,23 @@ | ||
use crate::{Context, Error}; | ||
|
||
#[poise::command(slash_command)] | ||
pub async fn hello(ctx: Context<'_>) -> Result<(), Error> { | ||
ctx.say("world!").await?; | ||
Ok(()) | ||
} | ||
|
||
#[poise::command(slash_command)] | ||
pub async fn ping(ctx: Context<'_>) -> Result<(), Error> { | ||
ctx.say("Pong!").await?; | ||
Ok(()) | ||
} | ||
|
||
#[poise::command(prefix_command)] | ||
pub async fn register(ctx: Context<'_>) -> Result<(), Error> { | ||
if ctx.author().id == 1182451860666318928 { | ||
poise::builtins::register_application_commands_buttons(ctx).await?; | ||
} else { | ||
ctx.say("You are not allowed to use this command!").await?; | ||
} | ||
Ok(()) | ||
} |
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