diff options
Diffstat (limited to 'src/commands/general')
| -rw-r--r-- | src/commands/general/emoji.rs | 22 | ||||
| -rw-r--r-- | src/commands/general/mod.rs | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/commands/general/emoji.rs b/src/commands/general/emoji.rs new file mode 100644 index 0000000..81cd9a3 --- /dev/null +++ b/src/commands/general/emoji.rs @@ -0,0 +1,22 @@ +use crate::{consts::Colors, Context, Error}; + +use poise::{ + serenity_prelude::{CreateEmbed, Emoji}, + CreateReply, +}; + +/// Get the URL for an emoji +#[poise::command(slash_command)] +pub async fn emoji(ctx: Context<'_>, emoji: Emoji) -> Result<(), Error> { + let url = emoji.url(); + let embed = CreateEmbed::new() + .title(emoji.name) + .color(Colors::Blue) + .image(&url) + .url(&url); + let message = CreateReply::default().embed(embed); + + ctx.send(message).await?; + + Ok(()) +} diff --git a/src/commands/general/mod.rs b/src/commands/general/mod.rs index 9bd3827..590dce1 100644 --- a/src/commands/general/mod.rs +++ b/src/commands/general/mod.rs @@ -2,6 +2,7 @@ pub mod ask; pub mod bing; pub mod config; pub mod convert; +pub mod emoji; pub mod pfp; pub mod random; pub mod version; |
