From fe85f82a099785d02c8b738efcec13f81bf581c2 Mon Sep 17 00:00:00 2001 From: jude Date: Sat, 7 May 2022 19:42:59 +0100 Subject: [PATCH] added activity --- src/event_handlers.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/event_handlers.rs b/src/event_handlers.rs index 89ab9b8..88d2464 100644 --- a/src/event_handlers.rs +++ b/src/event_handlers.rs @@ -1,12 +1,15 @@ use std::{collections::HashMap, env}; -use poise::serenity::{ - model::{ - channel::Channel, - interactions::{Interaction, InteractionResponseType}, +use poise::{ + serenity::{ + model::{ + channel::Channel, + interactions::{Interaction, InteractionResponseType}, + }, + prelude::Context, + utils::shard_id, }, - prelude::Context, - utils::shard_id, + serenity_prelude::Activity, }; use crate::{ @@ -17,6 +20,9 @@ use crate::{ pub async fn listener(ctx: &Context, event: &poise::Event<'_>, data: &Data) -> Result<(), Error> { match event { + poise::Event::CacheReady { .. } => { + ctx.set_activity(Activity::watching("for /play")).await; + } poise::Event::GuildCreate { guild, is_new, .. } => { if *is_new { if let Ok(token) = env::var("DISCORDBOTS_TOKEN") {