use std::sync::Arc; use serenity::{all::{ChannelId, CreateMessage, GuildId, Message}, http::Http}; use anyhow::Context; pub async fn get_system_channel(guild_id: GuildId, http: Arc) -> anyhow::Result { return http.get_guild(guild_id).await?.system_channel_id .context(format!("System channel of guild: {} not found", guild_id.get())); } pub async fn replace_msg(http: Arc, msg: Message, content: String) -> Result { msg.delete(http.clone()).await?; return ChannelId::new(msg.channel_id.get()).send_message(http.clone(), CreateMessage::new().content(content)).await; }