summaryrefslogtreecommitdiff
path: root/src/commands/general/emoji.rs
blob: 81cd9a3adef0af39c9aaf479704b12b585c46d97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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(())
}