浏览代码

added images/ folder and matchup command.

kmbrown418 6 年之前
父节点
当前提交
8218b301dc
共有 19 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      bot.rb
  2. 二进制
      images/Type Bug.png
  3. 二进制
      images/Type Dark.png
  4. 二进制
      images/Type Dragon.png
  5. 二进制
      images/Type Electric.png
  6. 二进制
      images/Type Fairy.png
  7. 二进制
      images/Type Fighting.png
  8. 二进制
      images/Type Fire.png
  9. 二进制
      images/Type Flying.png
  10. 二进制
      images/Type Ghost.png
  11. 二进制
      images/Type Grass.png
  12. 二进制
      images/Type Ground.png
  13. 二进制
      images/Type Ice.png
  14. 二进制
      images/Type Normal.png
  15. 二进制
      images/Type Poison.png
  16. 二进制
      images/Type Psychic.png
  17. 二进制
      images/Type Rock.png
  18. 二进制
      images/Type Steel.png
  19. 二进制
      images/Type Water.png

+ 13 - 1
bot.rb

@@ -62,10 +62,22 @@ hello = Command.new(:hello) do |event|
   )
 end
 
+matchup = Command.new(:matchup) do |event, type|
+  channel = event.channel.id
+  file = "images/Type #{type.capitalize}.png"
+
+  if File.exists?(file)
+    bot.send_file(channel, File.open(file, 'r'))
+  else
+    bot.respond("I do not know this pokemon type! Please try again!")
+  end
+end
+
 # ---
 
 commands = [
-  hello
+  hello,
+  matchup
 ]
 
 # This will trigger on every message sent in discord

二进制
images/Type Bug.png


二进制
images/Type Dark.png


二进制
images/Type Dragon.png


二进制
images/Type Electric.png


二进制
images/Type Fairy.png


二进制
images/Type Fighting.png


二进制
images/Type Fire.png


二进制
images/Type Flying.png


二进制
images/Type Ghost.png


二进制
images/Type Grass.png


二进制
images/Type Ground.png


二进制
images/Type Ice.png


二进制
images/Type Normal.png


二进制
images/Type Poison.png


二进制
images/Type Psychic.png


二进制
images/Type Rock.png


二进制
images/Type Steel.png


二进制
images/Type Water.png