potential fix
This commit is contained in:
@@ -199,7 +199,8 @@ impl TypeMapKey for AiChatKey {
|
||||
|
||||
#[poise::command(slash_command, prefix_command, guild_only, owners_only)]
|
||||
pub async fn ai_chat(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let manager = ctx.data().ai_chat.clone();
|
||||
let data = ctx.serenity_context().data.read().await;
|
||||
let manager = data.get::<AiChatKey>().cloned().ok_or_else(|| anyhow::anyhow!("AI Chat manager not found"))?;
|
||||
|
||||
let channel_id = ctx.channel_id();
|
||||
let enabled = manager.toggle_channel(channel_id).await;
|
||||
|
||||
@@ -237,7 +237,8 @@ pub async fn summary(
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let ai_chat_manager = ctx.data().ai_chat.clone();
|
||||
let data = ctx.serenity_context().data.read().await;
|
||||
let ai_chat_manager = data.get::<commands::fun::AiChatKey>().cloned().ok_or_else(|| anyhow::anyhow!("AI Chat manager not found"))?;
|
||||
let content = msg.content.trim();
|
||||
|
||||
if content.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user