Volume command works, fixed OAI create thread missing initial comment

This commit is contained in:
2023-07-26 12:33:46 -04:00
parent 91d8a8f42c
commit f4076ce9c3
4 changed files with 83 additions and 40 deletions

View File

@@ -36,7 +36,17 @@ impl EventHandler for Handler {
Some(oai) => {
match msg.mentions_me(&ctx.http).await {
Ok(mentioned) => {
if mentioned {
let bot_in_thread = match msg.channel_id.get_thread_members(&ctx.http).await {
Ok(t) => {
match t.iter().find(|t| t.user_id.unwrap().0 == ctx.cache.current_user_id().0) {
Some(_) => true,
None => false
}
}
Err(_) => false
};
// let has_bot = msg.channel_id.get_thread_members(&ctx.http).await.unwrap().contains(ctx.cache.current_user_id().0);
if mentioned || bot_in_thread {
commands::oai::generate_response(&ctx, &msg, oai, &self.pool).await;
}
}