Browse Source

added images/ folder and matchup command.

kmbrown418 6 years ago
parent
commit
4f591fd3b0

+ 2 - 1
README.md

@@ -17,7 +17,8 @@ $ git push origin/[branch_name]       #to push branch
 ```
 
 ### Features
-  * Says hello
+  * Says Hello
+  * Displays Type Matchups
 
 ## Setup
 This application runs using Ruby and Postgres. In order to run the bot locally

+ 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

BIN
images/Type Bug.png


BIN
images/Type Dark.png


BIN
images/Type Dragon.png


BIN
images/Type Electric.png


BIN
images/Type Fairy.png


BIN
images/Type Fighting.png


BIN
images/Type Fire.png


BIN
images/Type Flying.png


BIN
images/Type Ghost.png


BIN
images/Type Grass.png


BIN
images/Type Ground.png


BIN
images/Type Ice.png


BIN
images/Type Normal.png


BIN
images/Type Poison.png


BIN
images/Type Psychic.png


BIN
images/Type Rock.png


BIN
images/Type Steel.png


BIN
images/Type Water.png