Skip to content

Commit

Permalink
feat: auto join threads (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 25, 2023
1 parent b34c101 commit b98c331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"

members = [
"xp-bot",
Expand Down
4 changes: 4 additions & 0 deletions xp-bot/src/events/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ impl EventHandler for Handler {
let _ = GuildMember::set_xp(guild_id, user_id, &member.xp, &member).await;
}

async fn thread_create(&self, ctx: Context, thread: GuildChannel) {
thread.id.join_thread(ctx.http).await.unwrap();
}

async fn voice_state_update(&self, ctx: Context, old: Option<VoiceState>, new: VoiceState) {
// check if the event is a join, leave or move event
if old.is_none() && new.channel_id.is_some() {
Expand Down

0 comments on commit b98c331

Please sign in to comment.