瀏覽代碼

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