Move activity set out of Ready event
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use poise::serenity_prelude::{
|
||||
ActionRowComponent, ActivityData, ButtonKind, Context, CreateActionRow, CreateButton,
|
||||
ActionRowComponent, ButtonKind, Context, CreateActionRow, CreateButton,
|
||||
EditInteractionResponse, FullEvent, Interaction,
|
||||
};
|
||||
|
||||
@@ -18,9 +18,6 @@ use crate::{
|
||||
|
||||
pub async fn listener(ctx: &Context, event: &FullEvent, data: &Data) -> Result<(), Error> {
|
||||
match event {
|
||||
FullEvent::Ready { .. } => {
|
||||
ctx.set_activity(Some(ActivityData::watching("for /play")));
|
||||
}
|
||||
FullEvent::VoiceStateUpdate { old, new, .. } => {
|
||||
if let Some(past_state) = old {
|
||||
if let (Some(guild_id), None) = (past_state.guild_id, new.channel_id) {
|
||||
|
||||
@@ -18,7 +18,7 @@ use poise::serenity_prelude::{
|
||||
gateway::GatewayIntents,
|
||||
id::{GuildId, UserId},
|
||||
},
|
||||
ClientBuilder,
|
||||
ActivityData, ClientBuilder,
|
||||
};
|
||||
use songbird::SerenityInit;
|
||||
use sqlx::{MySql, Pool};
|
||||
@@ -138,6 +138,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
&discord_token,
|
||||
GatewayIntents::GUILD_VOICE_STATES | GatewayIntents::GUILDS,
|
||||
)
|
||||
.activity(ActivityData::watching("for /play"))
|
||||
.framework(framework)
|
||||
.register_songbird()
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user