smol bot
Diffstat (limited to 'src/bot/data.rs')
-rw-r--r--src/bot/data.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bot/data.rs b/src/bot/data.rs
index 4f3e205..e7da018 100644
--- a/src/bot/data.rs
+++ b/src/bot/data.rs
@@ -1,3 +1,5 @@
+use std::time::SystemTime;
+
use serde_json::json;
use serenity::json::Value;
@@ -6,12 +8,16 @@ use crate::bot::Context;
#[implicit_fn::implicit_fn]
pub fn log(c: &Context<'_>) {
let v = json! {{
- "locale": c.author().locale.as_deref().unwrap_or("unknown".into()),
+ // "locale": c.author().locale.as_deref().unwrap_or("unknown".into()),
"name": c.author().name.clone(),
"id": c.author().id,
"cname": &*c.command().name,
+ "at": SystemTime::now()
+ .duration_since(std::time::UNIX_EPOCH)
+ .expect("292 billion years have passed. goodbye cruel world."),
"guild": c.guild().map_or(0, |x|x.id.get()),
- "channel": c.channel_id()
+ "channel": c.channel_id(),
+ "message_id": match c { poise::Context::Application(_) => 0, poise::Context::Prefix(x) => x.msg.id.get() },
}};
push_j(v);
}