Explorar o código

add very basic hello command

Kylie Jo Swistak %!s(int64=6) %!d(string=hai) anos
pai
achega
3daa404578
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      bot.rb

+ 5 - 0
bot.rb

@@ -42,6 +42,11 @@ bot = Discordrb::Bot.new(token: token)
 
 # This will trigger on every message sent in discord
 bot.message do |event|
+  content = event.message.content
+
+  if content == '!hello'
+    event.respond("Hello there #{event.author.name}")
+  end
 end
 
 # This will trigger on every reaction is added in discord