Compare commits

..

2 Commits

Author SHA1 Message Date
24943a34b0 Log interaction's location 2023-12-10 12:53:10 +11:00
0588799d6e Add rust-version in Cargo.toml 2023-12-10 12:30:33 +11:00
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
[package] [package]
name = "kon" name = "kon"
version = "0.1.0" version = "0.1.0"
rust-version = "1.74"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -55,7 +55,11 @@ async fn main() {
commands::status::status() commands::status::status()
], ],
pre_command: |ctx| Box::pin(async move { pre_command: |ctx| Box::pin(async move {
println!("{} ran /{}", ctx.author().name, ctx.command().qualified_name) let get_guild_name = match ctx.guild() {
Some(guild) => guild.name.clone(),
None => String::from("DM")
};
println!("[{}] {} ran /{}", get_guild_name, ctx.author().name, ctx.command().qualified_name)
}), }),
..Default::default() ..Default::default()
}).setup(|ctx, ready, framework| Box::pin(on_ready(ctx, ready, framework))) }).setup(|ctx, ready, framework| Box::pin(on_ready(ctx, ready, framework)))