diff options
| author | seth <[email protected]> | 2023-07-01 13:13:45 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-07-01 13:13:45 -0400 |
| commit | 57783697051e75142268f21a834e62da9d239017 (patch) | |
| tree | 67a54e190e6b5cf38c565f72c0b1af96d7eae480 /src/main.rs | |
| parent | 403d4f185cb09c18723151d205c18be0aa7909a0 (diff) | |
chore: add support for allowing commands in multiple guilds
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 2e9a2f3..61a00c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,7 @@ mod consts; mod utils; const TEAWIE_GUILD: GuildId = GuildId(1055663552679137310); +const ALLOWED_GUILDS: [GuildId; 2] = [TEAWIE_GUILD, GuildId(1091969030694375444)]; const BOT: u64 = 1056467120986271764; #[group] @@ -33,7 +34,9 @@ impl EventHandler for Handler { async fn message(&self, ctx: Context, msg: Message) { let author = msg.author.id.as_u64(); - if author == &BOT || msg.guild_id.unwrap_or_else(|| GuildId::from(0)) != TEAWIE_GUILD { + if author == &BOT + || !ALLOWED_GUILDS.contains(&msg.guild_id.unwrap_or_else(|| GuildId::from(0))) + { return; } @@ -182,7 +185,7 @@ async fn random_teawie(ctx: &Context, msg: &Message) -> CommandResult { #[command] async fn teawiespam(ctx: &Context, msg: &Message) -> CommandResult { - if msg.guild_id.unwrap_or_else(|| GuildId::from(0)) != TEAWIE_GUILD { + if !ALLOWED_GUILDS.contains(&msg.guild_id.unwrap_or_else(|| GuildId::from(0))) { return Ok(()); } |
