浏览代码

add very basic hello command

Kylie Jo Swistak 6 年之前
父节点
当前提交
3daa404578
共有 1 个文件被更改,包括 5 次插入0 次删除
  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