generated from Oliver/discord-bot-template
add info to the invokation of index
This commit is contained in:
parent
78f5799748
commit
77c0c7af74
@ -265,8 +265,14 @@ async fn index(map: HashMap<ChannelId, GuildChannel>) -> Server {
|
||||
// NOTE!!! Make sure these names in quotes are lowercase!
|
||||
#[poise::command(slash_command, rename = "index", guild_only)]
|
||||
pub async fn index_cmd(ctx: Context<'_>) -> Result<(), Error> {
|
||||
|
||||
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 {
|
||||
Ok(ok) => {
|
||||
let server = index(ok).await;
|
||||
|
Loading…
Reference in New Issue
Block a user