silly goober bot
1use crate::types::Context;
2use color_eyre::eyre::Result;
3use poise::{
4 serenity_prelude::{CreateEmbed, CreateEmbedAuthor},
5 CreateReply,
6};
7
8/// Displays information about the bot
9#[poise::command(slash_command)]
10pub async fn botinfo(ctx: Context<'_>) -> Result<()> {
11 let rev = option_env!("BUILD_REV").unwrap_or("unknown");
12
13 let (bot_name, bot_face, bot_created_at) = {
14 let bot = ctx.cache().current_user();
15 (bot.name.clone(), bot.face().clone(), bot.created_at())
16 };
17
18 let embed = CreateReply::default().embed(
19 CreateEmbed::default()
20 .title("Bot Info")
21 .author(CreateEmbedAuthor::new(bot_name).icon_url(&bot_face))
22 .thumbnail(bot_face)
23 .color(0x00ff_ffff)
24 .field("Git rev", rev, false)
25 .field("Bot ID", "1087418361283092510", false)
26 .field("Code", "https://github.com/isabelroses/blahaj", false)
27 .field("Created at", bot_created_at.to_string(), false),
28 );
29
30 ctx.send(embed).await?;
31 Ok(())
32}