Skip to content

Commit

Permalink
Allow mods to say
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Nov 14, 2023
1 parent 9b3ec98 commit 8c4c869
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const ALLOWED_CHANNELS: [ChannelId; 2] = [
ChannelId(1115961098961702992),
];

const MOD_ROLE: RoleId = RoleId(1115957910284017714);

#[serenity::async_trait]
impl EventHandler for Handler {
async fn message(&self, context: Context, msg: Message) {
Expand Down Expand Up @@ -106,7 +108,7 @@ impl EventHandler for Handler {
}

if msg.content.starts_with("~say ") {
if msg.author.id == 415544018018238474 {
if msg.author.has_role(&context, msg.guild_id, MOD_ROLE) {
let message = msg.content.replace("~say ", "");
let _ = msg.channel_id.say(&context, message).await;
let _ = msg.delete(&context).await;
Expand Down

0 comments on commit 8c4c869

Please sign in to comment.