From b5dbfe336d6448bcd4038755051368097dd52981 Mon Sep 17 00:00:00 2001 From: jude Date: Sun, 7 Jul 2024 16:31:23 +0100 Subject: [PATCH] Don't set activity in ready event --- src/event_handlers.rs | 3 --- src/main.rs | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/event_handlers.rs b/src/event_handlers.rs index fb255a1..80cc258 100644 --- a/src/event_handlers.rs +++ b/src/event_handlers.rs @@ -13,9 +13,6 @@ pub async fn listener( data: &Data, ) -> Result<(), Error> { match event { - FullEvent::Ready { .. } => { - ctx.set_activity(Some(ActivityData::watching("for /remind"))); - } FullEvent::ChannelDelete { channel, .. } => { sqlx::query!("DELETE FROM channels WHERE channel = ?", channel.id.get()) .execute(&data.database) diff --git a/src/main.rs b/src/main.rs index 7835667..a8b0f44 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,6 +39,7 @@ use poise::serenity_prelude::{ }, ClientBuilder, }; +use serenity::all::ActivityData; use sqlx::{MySql, Pool}; use tokio::sync::{broadcast, broadcast::Sender, RwLock}; @@ -283,8 +284,10 @@ async fn _main(tx: Sender<()>) -> Result<(), Box> { .options(options) .build(); - let mut client = - ClientBuilder::new(&discord_token, GatewayIntents::GUILDS).framework(framework).await?; + let mut client = ClientBuilder::new(&discord_token, GatewayIntents::GUILDS) + .framework(framework) + .activity(ActivityData::watching("for /remind")) + .await?; client.start_autosharded().await?;