summaryrefslogtreecommitdiff
path: root/src/commands/general/emoji.rs
blob: d91b50c4c2dd41882bb42f801dcd8321a9c78a80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::{client::Context, consts::Colors};

use anyhow::Result;
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<()> {
	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(())
}