Parcourir la source

allow bot aide in clearing apps channel

Kylie Jo Swistak il y a 5 ans
Parent
commit
74de9c2c6c
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      bot.rb

+ 6 - 0
bot.rb

@@ -1005,6 +1005,12 @@ bot.message do |event|
       #"",
       #error_embed("Command not found!")
     #)
+  elsif event.message.channel.id == 644771348073152522 && content.match(/clear chat/i)
+    msgs = event.message.channel.history(10)
+    msgs.reject { |msg| msg.author.webhook? || msg.id == 651836628486062081 }
+
+    event.message.channel.delete_messages(msgs)
+
   elsif author == ENV['WEBHOOK'].to_i
     app = event.message.embeds.first
     if app.author.name == 'Character Application'