finished debug subcommands

This commit is contained in:
2026-02-24 18:27:50 +01:00
parent 7acfc33b74
commit 69fb19aa56
9 changed files with 112 additions and 13 deletions
+29
View File
@@ -0,0 +1,29 @@
use crate::{Context, Error, messages::send_msg};
pub async fn cmd(ctx: Context<'_>) -> Result<(), Error> {
let guilds = ctx.cache().guilds();
let mut msgs: Vec<Vec<String>> = vec![vec![]];
let mut char_count: usize = 0;
let mut msg_idx: usize = 0;
for g in guilds {
let name = g.name(ctx.cache()).unwrap_or("[unnamed]".to_string());
let id = g.get();
let msg = format!("**[{}]** {}", id, name);
char_count += msg.len();
if char_count >= 2000 {
msgs.push(Vec::new());
msg_idx += 1;
}
msgs[msg_idx].push(msg);
}
for msg in msgs
{ send_msg(ctx, msg.join("\n"), true, true).await; }
return Ok(());
}