botemon 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/botemon +18 -16
- data/lib/botemon.rb +1 -0
- data/lib/botemon/abilitydex.rb +25 -0
- data/lib/botemon/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmZjYjdlYjhhNzhiODU4Y2M5MTdjOTYyNTQ5ODAwODExYTI1MTkwNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmU1NzRhMDMxNDgwZDFmNWZlNDQ5NmE0ZjM3YmM3MGIwODJiM2E3YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDY2MjMyMDFmNDRkNzUyZWJhNWQxOWRjZDIzYWJiOGE2OTBlZDY3NTQ1ZDU3
|
10
|
+
MDMwZjQwZmZiMTA2MWU2MTQ2Yzc2ZjRkMjdiNzUwMGJmODdkYWY3OTc5MTIz
|
11
|
+
ZGRkZTZiNmIyNjIwYmEzZmQ1ZTAzNjM4YjhlYjVkOTgwNmZkN2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTRiMzI1MzBhOTc0NGE2YTcwZGRhZDc1ZGRjMWZmNzgzOWYyNWZjNTIzMzFk
|
14
|
+
ZDEwYmRmMDAxMjVhZWNlNTE4Y2MxZWRhNGZkMDc0OWEwYzNiNzIwYzVhNGQy
|
15
|
+
MDYzNWIxZDljNWNmZGVkNDMzMmEwMjczZDkxZGQ4M2RlNjUyYzk=
|
data/bin/botemon
CHANGED
@@ -46,28 +46,30 @@ Cinch::Bot.new {
|
|
46
46
|
@storage = Storage.new('./cache.db') unless @storage
|
47
47
|
|
48
48
|
name = Pokedex.id2name(name) if name.numeric?
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
else
|
53
|
-
pokemon = Pokedex.get name, @storage
|
54
|
-
m.reply pokemon ? "#{pokemon.to_s}\nhttp://www.smogon.com/bw/pokemon/#{name}".split("\n").map { |l| Format(:red, l) }.join("\n") : 'Pokémon not found.'
|
55
|
-
end
|
49
|
+
|
50
|
+
pokemon = Pokedex.get name, @storage
|
51
|
+
m.reply pokemon ? "#{pokemon.to_s}\nhttp://www.smogon.com/bw/pokemon/#{name}".split("\n").map { |l| Format(:red, l) }.join("\n") : 'Pokémon not found.'
|
56
52
|
end
|
57
53
|
|
58
54
|
on :message, /^moveset (.+) (.+)/ do |m, name, tier|
|
59
55
|
name = Pokedex.id2name(name) if name.numeric?
|
60
56
|
|
61
|
-
|
62
|
-
|
57
|
+
|
58
|
+
movesets = Movedex.get name, tier
|
59
|
+
if movesets != nil || movesets.any?
|
60
|
+
m.reply Format(:red, "--- #{movesets.first.pokemon} (#{movesets.first.tier}) ---")
|
61
|
+
movesets.each { |moveset| m.reply Format(:red, " -- #{moveset.name} --\n#{moveset.to_s.split("\n").map { |l| Format(:red, l) }.join("\n")}\n") }
|
63
62
|
else
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
63
|
+
m.reply Format(:red, 'Moveset not found.')
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
on :message, /^ability (.+)/ do |m, name|
|
68
|
+
ability = Abilitydex.get name
|
69
|
+
if ability != nil
|
70
|
+
m.reply Format(:red, "#{ability.to_s.split("\n").map { |l| Format(:red, l) }.join("\n")}")
|
71
|
+
else
|
72
|
+
m.reply Format(:red, 'Ability not found.')
|
71
73
|
end
|
72
74
|
end
|
73
75
|
|
data/lib/botemon.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
class Abilitydex
|
21
|
+
def self.get(name)
|
22
|
+
return nil if name == nil
|
23
|
+
return Smogon::Abilitydex.get name
|
24
|
+
end
|
25
|
+
end
|
data/lib/botemon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: botemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
@@ -87,6 +87,7 @@ executables:
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- lib/botemon/abilitydex.rb
|
90
91
|
- lib/botemon/movedex.rb
|
91
92
|
- lib/botemon/pokedex.rb
|
92
93
|
- lib/botemon/smogon/moveset.rb
|