Просмотр исходного кода

don't award xp to bots and webhooks

Kylie Jo Swistak 6 лет назад
Родитель
Сommit
96db30e21c
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      bot.rb

+ 2 - 1
bot.rb

@@ -818,10 +818,11 @@ bot.message do |event|
     end
   elsif content == 'import users' && author == 215240568245190656
     User.import_user(File.open('users.txt', 'r'))
-  elsif !event.author.current_bot?
+  elsif !event.author.bot_account? && !event.author.webhook?
     usr = User.find_by(id: author.to_s)
     msg = URL.match(content) ? content.gsub(URL, "x" * 149) : content
 
+    binding.pr
     img = usr.update_xp(msg, event.author)
     bot.send_file(event.message.channel, File.open(img, 'r')) if img
   end