Skip to content

Commit

Permalink
Change startup status to show message
Browse files Browse the repository at this point in the history
  • Loading branch information
tazz4843 committed Dec 16, 2023
1 parent ddbb1ac commit 8e0f9a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions scripty_bot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use scripty_bot_utils::{
handler,
Data,
};
use serenity::{all::OnlineStatus, gateway::ActivityData};

pub async fn entrypoint() {
// fetch the config
Expand Down Expand Up @@ -61,6 +62,8 @@ pub async fn entrypoint() {
.event_handler(handler::BotEventHandler)
.raw_event_handler(handler::RawEventHandler)
.register_songbird_from_config(scripty_audio_handler::get_songbird())
.status(OnlineStatus::Idle)
.activity(ActivityData::custom("Starting up..."))
.await
.expect("failed to create serenity client");

Expand Down
6 changes: 4 additions & 2 deletions scripty_bot_utils/src/background_tasks/tasks/status_update.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{sync::Arc, time::Duration};

use serenity::{
all::ActivityType,
all::{ActivityType, OnlineStatus},
client::Context as SerenityContext,
gateway::{ActivityData, ShardManager},
};
Expand Down Expand Up @@ -72,7 +72,9 @@ impl BackgroundTask for StatusUpdater {
};

// set activity
shard_info.runner_tx.set_activity(Some(activity));
shard_info
.runner_tx
.set_presence(Some(activity), OnlineStatus::Online);
}
}

Expand Down

0 comments on commit 8e0f9a1

Please sign in to comment.