-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to poise * Remove MESSAGE_CONTENT intent * Update deps * FMT
- Loading branch information
1 parent
124dac8
commit 9fa9f37
Showing
17 changed files
with
377 additions
and
445 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use crate::CommandContext; | ||
|
||
/// Get help | ||
#[poise::command(slash_command)] | ||
pub async fn help( | ||
ctx: CommandContext<'_>, | ||
#[description = "Command to get help for"] mut command: Option<String>, | ||
) -> anyhow::Result<()> { | ||
if ctx.invoked_command_name() != "help" { | ||
command = match command { | ||
Some(command) => Some(format!("{} {}", ctx.invoked_command_name(), command)), | ||
None => Some(ctx.invoked_command_name().to_string()), | ||
}; | ||
} | ||
|
||
poise::builtins::help(ctx, command.as_deref(), Default::default()).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
use serenity::{ | ||
client::Context, | ||
framework::standard::{ | ||
macros::command, | ||
Args, | ||
CommandResult, | ||
}, | ||
model::channel::Message, | ||
}; | ||
use crate::CommandContext; | ||
|
||
#[command] | ||
#[description("Get an invite link for this bot")] | ||
pub async fn invite(ctx: &Context, msg: &Message, _args: Args) -> CommandResult { | ||
let app_info = ctx.http.get_current_application_info().await?; | ||
/// Get an invite link for this bot | ||
#[poise::command(slash_command)] | ||
pub async fn invite(ctx: CommandContext<'_>) -> anyhow::Result<()> { | ||
let app_info = ctx.http().get_current_application_info().await?; | ||
|
||
let id = app_info.id; | ||
let permissions = "1341644225"; | ||
let link = format!( | ||
"https://discordapp.com/oauth2/authorize?client_id={id}&scope=bot&permissions={permissions}", | ||
); | ||
msg.channel_id.say(&ctx.http, &link).await?; | ||
ctx.say(link).await?; | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.