silly goober bot
1use crate::types::Context;
2use color_eyre::eyre::Result;
3use poise::serenity_prelude::User;
4
5/// Displays your or another user's avatar
6#[poise::command(slash_command)]
7pub async fn avatar(
8 ctx: Context<'_>,
9 #[description = "Selected user"] user: Option<User>,
10) -> Result<()> {
11 let user = user.as_ref().unwrap_or_else(|| ctx.author());
12 let avatar = user.avatar_url().expect("Could not get avatar URL");
13 ctx.say(avatar).await?;
14 Ok(())
15}