add info to the invokation of index

This commit is contained in:
Oliver Atkinson 2024-07-25 14:31:21 -06:00
parent 78f5799748
commit 77c0c7af74

View File

@ -265,8 +265,14 @@ async fn index(map: HashMap<ChannelId, GuildChannel>) -> Server {
// NOTE!!! Make sure these names in quotes are lowercase! // NOTE!!! Make sure these names in quotes are lowercase!
#[poise::command(slash_command, rename = "index", guild_only)] #[poise::command(slash_command, rename = "index", guild_only)]
pub async fn index_cmd(ctx: Context<'_>) -> Result<(), Error> { pub async fn index_cmd(ctx: Context<'_>) -> Result<(), Error> {
let guild = ctx.guild_id().unwrap().to_partial_guild(ctx.serenity_context()).await.unwrap(); let guild = ctx.guild_id().unwrap().to_partial_guild(ctx.serenity_context()).await.unwrap();
let invoker = ctx.author().name.clone();
if let Some(nickname) = ctx.author().nick_in(ctx.http(), guild.id).await {
info!("{invoker} ({nickname}) is indexing {}", guild.name);
} else {
info!("{invoker} is indexing {}", guild.name);
}
match guild.channels(ctx.http()).await { match guild.channels(ctx.http()).await {
Ok(ok) => { Ok(ok) => {
let server = index(ok).await; let server = index(ok).await;