discordrb 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of discordrb might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d6b8f8e3fef1615a2e7963791b338038e425687
4
- data.tar.gz: 9319f93cbd5893e2f46ef76353b8a9ea326cc707
3
+ metadata.gz: 66f79878220c4bf42ad27bc01ab409d6613670be
4
+ data.tar.gz: 4bd26ca3ca4739a855344b3d0d867f8d616958ad
5
5
  SHA512:
6
- metadata.gz: 09f9d9c69de557771251771096ae0bee4957d529ca2882312fdec7d88fa2a87531e5885a7d17e7016ec235a01d2ec4e76871eca084639cd4205c5730ad758385
7
- data.tar.gz: 8c9cef441cfd168f8d5f06da90cd62e3f9bec4ef47f1cb992342c0d982224bc7d20014b517dad03ae12786ccab55d208dfbeab1cd607e647ddbba123456ba3f1
6
+ metadata.gz: 6e83dde0d98d3cb8ad65d64964c5731d97b526fc89865f25a0c57fa2c9bf0cd6d936b28fd81b39e74156a64e602253476479a588f9ff92a76eb39cf9c1d1e756
7
+ data.tar.gz: 174fd8785f53d910b88b6146b3ae657e83bed445163de278f9be0f3a848d9097206835e82da5f18f8051ab5c2676bbeba42dae48e58cc480d83d5368072cdf46
data/lib/discordrb/bot.rb CHANGED
@@ -2,8 +2,6 @@ require 'rest-client'
2
2
  require 'faye/websocket'
3
3
  require 'eventmachine'
4
4
 
5
- require 'discordrb/endpoints/endpoints'
6
-
7
5
  require 'discordrb/events/message'
8
6
  require 'discordrb/events/typing'
9
7
  require 'discordrb/events/lifetime'
@@ -18,7 +16,7 @@ require 'discordrb/events/guild-role-delete'
18
16
  require 'discordrb/events/guild-role-update'
19
17
 
20
18
  require 'discordrb/api'
21
-
19
+ require 'discordrb/games'
22
20
  require 'discordrb/exceptions'
23
21
  require 'discordrb/data'
24
22
 
@@ -117,6 +115,22 @@ module Discordrb
117
115
  API.send_file(@token, channel_id, file)
118
116
  end
119
117
 
118
+ def game=(name_or_id)
119
+ game = Discordrb::Games.find_game(name_or_id)
120
+ @game = game
121
+
122
+ data = {
123
+ 'op' => 3,
124
+ 'd' => {
125
+ 'idle_since' => nil,
126
+ 'game_id' => game ? game.id : 60 # 60 blanks out the game playing
127
+ }
128
+ }
129
+
130
+ @ws.send(data.to_json)
131
+ game
132
+ end
133
+
120
134
  def debug=(debug)
121
135
  @debug = debug
122
136
  end
@@ -220,7 +234,7 @@ module Discordrb
220
234
  end
221
235
  end
222
236
  user.status = status
223
- user.game_id = data['game_id']
237
+ user.game = Discordrb::Games.find_game(data['game_id'])
224
238
  end
225
239
 
226
240
  # Internal handler for VOICE_STATUS_UPDATE
@@ -105,6 +105,7 @@ module Discordrb::Commands
105
105
  end
106
106
 
107
107
  def simple_execute(chain, event)
108
+ return nil if chain.empty?
108
109
  args = chain.split(' ')
109
110
  execute_command(args[0].to_sym, event, args[1..-1])
110
111
  end
@@ -115,6 +116,12 @@ module Discordrb::Commands
115
116
 
116
117
  if message.content.start_with? @prefix
117
118
  chain = message.content[@prefix.length..-1]
119
+
120
+ if chain.strip.empty?
121
+ debug("Chain is empty")
122
+ return
123
+ end
124
+
118
125
  debug("Parsing command chain #{chain}")
119
126
  result = (@attributes[:advanced_functionality]) ? CommandChain.new(chain, self).execute(event) : simple_execute(chain, event)
120
127
  result = event.saved_message + (result || '')
@@ -3,13 +3,14 @@
3
3
  require 'ostruct'
4
4
  require 'discordrb/permissions'
5
5
  require 'discordrb/api'
6
+ require 'discordrb/games'
6
7
 
7
8
  module Discordrb
8
9
  class User
9
10
  attr_reader :username, :id, :discriminator, :avatar
10
11
 
11
12
  attr_accessor :status
12
- attr_accessor :game_id
13
+ attr_accessor :game
13
14
  attr_accessor :server_mute
14
15
  attr_accessor :server_deaf
15
16
  attr_accessor :self_mute
@@ -136,7 +137,7 @@ module Discordrb
136
137
  end
137
138
 
138
139
  class Channel
139
- attr_reader :name, :server, :type, :id, :is_private, :recipient, :topic
140
+ attr_reader :name, :server, :type, :id, :is_private, :recipient, :topic, :position
140
141
 
141
142
  attr_reader :permission_overwrites
142
143
 
@@ -149,6 +150,7 @@ module Discordrb
149
150
  @id = data['id'].to_i
150
151
  @type = data['type'] || 'text'
151
152
  @topic = data['topic']
153
+ @position = data['position']
152
154
 
153
155
  @is_private = data['is_private']
154
156
  if @is_private
@@ -182,6 +184,25 @@ module Discordrb
182
184
  @bot.send_file(@id, file)
183
185
  end
184
186
 
187
+ def delete
188
+ API.delete_channel(@bot.token, @id)
189
+ end
190
+
191
+ def name=(name)
192
+ @name = name
193
+ update_channel_data
194
+ end
195
+
196
+ def topic=(topic)
197
+ @topic = topic
198
+ update_channel_data
199
+ end
200
+
201
+ def position=(position)
202
+ @position = position
203
+ update_channel_data
204
+ end
205
+
185
206
  def update_from(other)
186
207
  @topic = other.topic
187
208
  @name = other.name
@@ -209,6 +230,12 @@ module Discordrb
209
230
 
210
231
  alias_method :send, :send_message
211
232
  alias_method :message, :send_message
233
+
234
+ private
235
+
236
+ def update_channel_data
237
+ API.update_channel(@bot.token, @id, @name, @topic, @position)
238
+ end
212
239
  end
213
240
 
214
241
  class Message
@@ -292,7 +319,7 @@ module Discordrb
292
319
  user = members_by_id[user_id]
293
320
  if user
294
321
  user.status = element['status'].to_sym
295
- user.game_id = element['game_id']
322
+ user.game = Discordrb::Games.find_game(element['game_id'])
296
323
  end
297
324
  end
298
325
  end
@@ -344,6 +371,11 @@ module Discordrb
344
371
  channel.update_overwrites(overwrites)
345
372
  end
346
373
  end
374
+
375
+ def create_channel(name)
376
+ response = API.create_channel(@bot.token, @id, name, 'text')
377
+ Channel.new(JSON.parse(response), @bot)
378
+ end
347
379
  end
348
380
 
349
381
  class ColorRGB
@@ -0,0 +1,334 @@
1
+ module Discordrb::Games
2
+ class Game
3
+ attr_reader :id, :name, :executables
4
+
5
+ def initialize(hash)
6
+ @id = hash[:id]
7
+ @name = hash[:name]
8
+ @executables = hash[:executables]
9
+ end
10
+ end
11
+
12
+ @raw_games = [
13
+ {executables: {win32: ["pol.exe"]}, id: 0, name: "FINAL FANTASY XI"},
14
+ {executables: {win32: ["ffxiv.exe", "ffxiv_dx11.exe"]}, id: 1, name: "FINAL FANTASY XIV"},
15
+ {executables: {win32: ["Wow.exe", "Wow-64.exe"]}, id: 3, name: "World of Warcraft"},
16
+ {executables: {darwin: ["LoLLauncher.app"], win32: ["LolClient.exe", "League of Legends.exe"]}, id: 4, name: "League of Legends"},
17
+ {executables: {darwin: ["Diablo%20III.app"], win32: ["Diablo III.exe"]}, id: 5, name: "Diablo 3"},
18
+ {executables: {darwin: ["dota_osx.app"], win32: ["dota2.exe"]}, id: 6, name: "DOTA 2"},
19
+ {executables: {darwin: ["Heroes.app"], win32: ["Heroes of the Storm.exe", "HeroesOfTheStorm_x64.exe", "HeroesOfTheStorm.exe"]}, id: 7, name: "Heroes of the Storm"},
20
+ {executables: {darwin: ["Hearthstone.app"], win32: ["Hearthstone.exe"]}, id: 8, name: "Hearthstone"},
21
+ {executables: {win32: ["csgo.exe"]}, id: 9, name: "Counter-Strike: Global Offensive"},
22
+ {executables: {win32: ["WorldOfTanks.exe"]}, id: 10, name: "World of Tanks"},
23
+ {executables: {darwin: ["gw2.app"], win32: ["gw2.exe"]}, id: 11, name: "Guild Wars 2"},
24
+ {executables: {win32: ["dayz.exe"]}, id: 12, name: "Day Z"},
25
+ {executables: {darwin: ["starcraft%20ii.app"], win32: ["starcraft ii.exe", "SC2_x64.exe", "SC2.exe"]}, id: 13, name: "Starcraft II"},
26
+ {executables: {win32: ["diablo.exe"]}, id: 14, name: "Diablo"},
27
+ {executables: {win32: ["diablo ii.exe"]}, id: 15, name: "Diablo 2"},
28
+ {executables: {win32: ["left4dead.exe"]}, id: 17, name: "Left 4 Dead"},
29
+ {executables: {darwin: ["minecraft.app"], win32: ["minecraft.exe"]}, id: 18, name: "Minecraft"},
30
+ {executables: {win32: ["smite.exe"]}, id: 19, name: "Smite"},
31
+ {executables: {win32: ["bf4.exe"]}, id: 20, name: "Battlefield 4"},
32
+ {executables: {win32: ["AoK HD.exe", "empires2.exe"]}, id: 101, name: "Age of Empire II"},
33
+ {executables: {win32: ["age3y.exe"]}, id: 102, name: "Age of Empire III"},
34
+ {executables: {win32: ["AlanWake.exe"]}, id: 104, name: "Alan Wake"},
35
+ {executables: {win32: ["alan_wakes_american_nightmare.exe"]}, id: 105, name: "Alan Wake's American Nightmare"},
36
+ {executables: {win32: ["AlienBreed2Assault.exe"]}, id: 106, name: "Alien Breed 2: Assault"},
37
+ {executables: {win32: ["Amnesia.exe"]}, id: 107, name: "Amnesia: The Dark Descent"},
38
+ {executables: {win32: ["UDK.exe"]}, id: 108, name: "Antichamber"},
39
+ {executables: {win32: ["ArcheAge.exe"]}, id: 109, name: "ArcheAge"},
40
+ {executables: {win32: ["arma3.exe"]}, id: 110, name: "Arma III"},
41
+ {executables: {win32: ["AC3SP.exe"]}, id: 111, name: "Assassin's Creed 3"},
42
+ {executables: {win32: ["Bastion.exe"]}, id: 112, name: "Bastion"},
43
+ {executables: {win32: ["BF2.exe"]}, id: 113, name: "Battlefield 2"},
44
+ {executables: {win32: ["bf3.exe"]}, id: 114, name: "Battlefield 3"},
45
+ {executables: {win32: ["Besiege.exe"]}, id: 116, name: "Besiege"},
46
+ {executables: {win32: ["Bioshock.exe"]}, id: 117, name: "Bioshock"},
47
+ {executables: {win32: ["Bioshock2.exe"]}, id: 118, name: "BioShock II"},
48
+ {executables: {win32: ["BioShockInfinite.exe"]}, id: 119, name: "BioShock Infinite"},
49
+ {executables: {win32: ["Borderlands2.exe"]}, id: 122, name: "Borderlands 2"},
50
+ {executables: {win32: ["braid.exe"]}, id: 123, name: "Braid"},
51
+ {executables: {win32: ["ShippingPC-StormGame.exe"]}, id: 124, name: "Bulletstorm"},
52
+ {executables: {}, id: 125, name: "Cabal 2"},
53
+ {executables: {win32: ["CabalMain.exe"]}, id: 126, name: "Cabal Online"},
54
+ {executables: {win32: ["iw4mp.exe", "iw4sp.exe"]}, id: 127, name: "Call of Duty: Modern Warfare 2"},
55
+ {executables: {win32: ["t6sp.exe"]}, id: 128, name: "Call of Duty: Black Ops"},
56
+ {executables: {win32: ["iw5mp.exe"]}, id: 129, name: "Call of Duty: Modern Warfare 3"},
57
+ {executables: {win32: ["RelicCOH.exe"]}, id: 132, name: "Company of Heroes"},
58
+ {executables: {win32: ["Crysis64.exe"]}, id: 135, name: "Crysis"},
59
+ {executables: {win32: ["Crysis2.exe"]}, id: 136, name: "Crysis 2"},
60
+ {executables: {win32: ["Crysis3.exe"]}, id: 137, name: "Crysis 3"},
61
+ {executables: {win32: ["Crysis.exe"]}, id: 138, name: "Crysis 4 "},
62
+ {executables: {win32: ["DATA.exe"]}, id: 140, name: "Dark Souls"},
63
+ {executables: {win32: ["DarkSoulsII.exe"]}, id: 141, name: "Dark Souls II"},
64
+ {executables: {win32: ["dfuw.exe"]}, id: 142, name: "Darkfall: Unholy Wars"},
65
+ {executables: {win32: ["DCGAME.exe"]}, id: 144, name: "DC Universe Online"},
66
+ {executables: {win32: ["DeadIslandGame.exe"]}, id: 145, name: "Dead Island"},
67
+ {executables: {win32: ["deadspace2.exe"]}, id: 146, name: "Dead Space 2"},
68
+ {executables: {win32: ["LOTDGame.exe"]}, id: 147, name: "Deadlight"},
69
+ {executables: {win32: ["dxhr.exe"]}, id: 148, name: "Deus Ex: Human Revolution"},
70
+ {executables: {win32: ["DeviMayCry4.exe"]}, id: 149, name: "Devil May Cry 4"},
71
+ {executables: {win32: ["DMC-DevilMayCry.exe"]}, id: 150, name: "DmC Devil May Cry"},
72
+ {executables: {win32: ["dirt2_game.exe"]}, id: 154, name: "DiRT 2"},
73
+ {executables: {win32: ["dirt3_game.exe"]}, id: 155, name: "DiRT 3"},
74
+ {executables: {win32: ["dota.exe"]}, id: 156, name: "DOTA"},
75
+ {executables: {win32: ["DoubleDragon.exe"]}, id: 158, name: "Double Dragon Neon"},
76
+ {executables: {win32: ["DragonAge2.exe"]}, id: 159, name: "Dragon Age II"},
77
+ {executables: {win32: ["DragonAgeInquisition.exe"]}, id: 160, name: "Dragon Age: Inquisition"},
78
+ {executables: {win32: ["daorigins.exe"]}, id: 161, name: "Dragon Age: Origins"},
79
+ {executables: {win32: ["DBXV.exe"]}, id: 162, name: "Dragon Ball XenoVerse"},
80
+ {executables: {win32: ["DukeForever.exe"]}, id: 163, name: "Duke Nukem Forever"},
81
+ {executables: {darwin: ["Dustforce.app"], win32: ["dustforce.exe"]}, id: 164, name: "Dustforce"},
82
+ {executables: {win32: ["EliteDangerous32.exe"]}, id: 165, name: "Elite: Dangerous"},
83
+ {executables: {win32: ["exefile.exe"]}, id: 166, name: "Eve Online"},
84
+ {executables: {win32: ["eqgame.exe"]}, id: 167, name: "EverQuest"},
85
+ {executables: {win32: ["EverQuest2.exe"]}, id: 168, name: "EverQuest II"},
86
+ {executables: {}, id: 169, name: "EverQuest Next"},
87
+ {executables: {win32: ["Engine.exe"]}, id: 170, name: "F.E.A.R."},
88
+ {executables: {win32: ["FEAR2.exe"]}, id: 171, name: "F.E.A.R. 2: Project Origin"},
89
+ {executables: {win32: ["fallout3.exe"]}, id: 172, name: "Fallout 3"},
90
+ {executables: {win32: ["FalloutNV.exe"]}, id: 174, name: "Fallout: New Vegas"},
91
+ {executables: {win32: ["farcry3.exe"]}, id: 175, name: "Far Cry 3"},
92
+ {executables: {win32: ["fifa15.exe"]}, id: 176, name: "FIFA 15"},
93
+ {executables: {win32: ["FTLGame.exe"]}, id: 180, name: "FTL: Faster Than Light"},
94
+ {executables: {win32: ["GTAIV.exe"]}, id: 181, name: "Grand Theft Auto 4"},
95
+ {executables: {win32: ["GTA5.exe"]}, id: 182, name: "Grand Theft Auto 5"},
96
+ {executables: {win32: ["Gw.exe"]}, id: 183, name: "Guild Wars"},
97
+ {executables: {win32: ["H1Z1.exe"]}, id: 186, name: "H1Z1"},
98
+ {executables: {win32: ["HL2HL2.exe", "hl2.exe"]}, id: 188, name: "Half Life 2"},
99
+ {executables: {win32: ["HOMEFRONT.exe"]}, id: 195, name: "Homefront"},
100
+ {executables: {win32: ["invisibleinc.exe"]}, id: 196, name: "Invisible Inc."},
101
+ {executables: {win32: ["LANoire.exe"]}, id: 197, name: "L.A. Noire"},
102
+ {executables: {win32: ["Landmark64.exe"]}, id: 198, name: "Landmark"},
103
+ {executables: {win32: ["left4dead2.exe"]}, id: 201, name: "Left 4 Dead 2"},
104
+ {executables: {win32: ["lineage.exe"]}, id: 203, name: "Lineage"},
105
+ {executables: {win32: ["Magicka.exe"]}, id: 206, name: "Magicka"},
106
+ {executables: {win32: ["MapleStory.exe"]}, id: 208, name: "MapleStory"},
107
+ {executables: {}, id: 209, name: "Mark of the Ninja"},
108
+ {executables: {win32: ["MassEffect.exe"]}, id: 210, name: "Mass Effect"},
109
+ {executables: {win32: ["MassEffect2.exe"]}, id: 211, name: "Mass Effect 2"},
110
+ {executables: {win32: ["MassEffect3Demo.exe"]}, id: 212, name: "Mass Effect 3"},
111
+ {executables: {win32: ["METAL GEAR RISING REVENGEANCE.exe"]}, id: 214, name: "Metal Gear Rising: Revengeance"},
112
+ {executables: {win32: ["metro2033.exe"]}, id: 215, name: "Metro 2033"},
113
+ {executables: {win32: ["MetroLL.exe"]}, id: 216, name: "Metro Last Light"},
114
+ {executables: {win32: ["MK10.exe"]}, id: 218, name: "Mortal Kombat X"},
115
+ {executables: {win32: ["speed.exe"]}, id: 219, name: "Need For Speed Most Wanted"},
116
+ {executables: {}, id: 220, name: "Neverwinder"},
117
+ {executables: {darwin: ["Outlast.app"], win32: ["OLGame.exe"]}, id: 221, name: "Outlast"},
118
+ {executables: {win32: ["PapersPlease.exe"]}, id: 222, name: "Papers, Please"},
119
+ {executables: {win32: ["payday_win32_release.exe"]}, id: 223, name: "PAYDAY"},
120
+ {executables: {win32: ["payday2_win32_release.exe"]}, id: 224, name: "PAYDAY2"},
121
+ {executables: {win32: ["PillarsOfEternity.exe"]}, id: 225, name: "Pillars of Eternity"},
122
+ {executables: {win32: ["PA.exe"]}, id: 226, name: "Planetary Annihilation"},
123
+ {executables: {win32: ["planetside2_x86.exe"]}, id: 227, name: "Planetside 2"},
124
+ {executables: {win32: ["hl2P.exe"]}, id: 228, name: "Portal"},
125
+ {executables: {win32: ["portal2.exe"]}, id: 229, name: "Portal 2"},
126
+ {executables: {win32: ["PrimalCarnageGame.exe"]}, id: 231, name: "Primal Cargnage"},
127
+ {executables: {win32: ["pCARS.exe"]}, id: 232, name: "Project Cars"},
128
+ {executables: {win32: ["RaceTheSun.exe"]}, id: 233, name: "Race The Sun"},
129
+ {executables: {win32: ["Rage.exe"]}, id: 234, name: "RAGE"},
130
+ {executables: {win32: ["ragexe.exe"]}, id: 235, name: "Ragnarok Online"},
131
+ {executables: {win32: ["rift.exe"]}, id: 236, name: "Rift"},
132
+ {executables: {win32: ["Rocksmith2014.exe"]}, id: 237, name: "Rocksmith 2014"},
133
+ {executables: {win32: ["SwiftKit-RS.exe", "JagexLauncher.exe"]}, id: 238, name: "RuneScape"},
134
+ {executables: {win32: ["Shadowgrounds.exe"]}, id: 239, name: "Shadowgrounds"},
135
+ {executables: {win32: ["survivor.exe"]}, id: 240, name: "Shadowgrounds: Survivor"},
136
+ {executables: {win32: ["ShovelKnight.exe"]}, id: 241, name: "Shovel Knight"},
137
+ {executables: {win32: ["SimCity.exe"]}, id: 242, name: "SimCity"},
138
+ {executables: {win32: ["SporeApp.exe"]}, id: 245, name: "Spore"},
139
+ {executables: {win32: ["StarCitizen.exe"]}, id: 246, name: "Star Citizen"},
140
+ {executables: {}, id: 247, name: "Star Trek Online"},
141
+ {executables: {win32: ["battlefront.exe"]}, id: 248, name: "Star Wars Battlefront"},
142
+ {executables: {win32: ["swtor.exe"]}, id: 249, name: "Star Wars: The Old Republic"},
143
+ {executables: {win32: ["starbound.exe", "starbound_opengl.exe"]}, id: 250, name: "Starbound"},
144
+ {executables: {win32: ["starcraft.exe"]}, id: 251, name: "Starcraft"},
145
+ {executables: {win32: ["SSFIV.exe"]}, id: 253, name: "Ultra Street Fighter IV"},
146
+ {executables: {win32: ["superhexagon.exe"]}, id: 254, name: "Super Hexagon"},
147
+ {executables: {win32: ["swordandsworcery_pc.exe"]}, id: 255, name: "Superbrothers: Sword & Sworcery EP"},
148
+ {executables: {win32: ["hl2TF.exe"]}, id: 256, name: "Team Fortress 2"},
149
+ {executables: {win32: ["TERA.exe"]}, id: 258, name: "TERA"},
150
+ {executables: {win32: ["Terraria.exe"]}, id: 259, name: "Terraria"},
151
+ {executables: {win32: ["Bethesda.net_Launcher.exe"]}, id: 260, name: "The Elder Scrolls Online"},
152
+ {executables: {win32: ["TESV.exe"]}, id: 261, name: "The Elder Scrolls V: Skyrim"},
153
+ {executables: {win32: ["TheSecretWorld.exe"]}, id: 262, name: "The Secret World"},
154
+ {executables: {win32: ["TS3.exe", "ts3w.exe"]}, id: 264, name: "The Sims 3"},
155
+ {executables: {win32: ["WALKINGDEAD101.EXE"]}, id: 265, name: "The Walking Dead"},
156
+ {executables: {win32: ["TheWalkingDead2.exe"]}, id: 266, name: "The Walking Dead Season Two"},
157
+ {executables: {win32: ["witcher3.exe"]}, id: 267, name: "The Witcher 3"},
158
+ {executables: {win32: ["Future Soldier.exe"]}, id: 268, name: "Tom Clancy's Ghost Recon: Future Solider"},
159
+ {executables: {win32: ["TombRaider.exe"]}, id: 269, name: "Tomb Raider (2013)"},
160
+ {executables: {win32: ["Torchlight.exe"]}, id: 271, name: "Torchlight"},
161
+ {executables: {win32: ["Torchlight2.exe"]}, id: 272, name: "Torchlight 2"},
162
+ {executables: {win32: ["Shogun2.exe"]}, id: 273, name: "Total War: Shogun 2"},
163
+ {executables: {win32: ["Transistor.exe"]}, id: 274, name: "Transistor"},
164
+ {executables: {win32: ["trine.exe"]}, id: 275, name: "Trine"},
165
+ {executables: {win32: ["trine2_32bit.exe"]}, id: 276, name: "Trine 2"},
166
+ {executables: {win32: ["UOKR.exe"]}, id: 277, name: "Ultima Online"},
167
+ {executables: {win32: ["aces.exe"]}, id: 279, name: "War Thunder"},
168
+ {executables: {win32: ["Warcraft III.exe", "wc3.exe"]}, id: 281, name: "Warcraft 3: Reign of Chaos"},
169
+ {executables: {win32: ["Warcraft II BNE.exe"]}, id: 282, name: "Warcraft II"},
170
+ {executables: {win32: ["Warframe.x64.exe", "Warframe.exe"]}, id: 283, name: "Warframe"},
171
+ {executables: {win32: ["watch_dogs.exe"]}, id: 284, name: "Watch Dogs"},
172
+ {executables: {win32: ["WildStar64.exe"]}, id: 285, name: "WildStar"},
173
+ {executables: {win32: ["XComGame.exe"]}, id: 288, name: "XCOM: Enemy Unknown"},
174
+ {executables: {win32: ["DFO.exe", "dfo.exe"]}, id: 289, name: "Dungeon Fighter Online"},
175
+ {executables: {win32: ["aclauncher.exe", "acclient.exe"]}, id: 290, name: "Asheron's Call"},
176
+ {executables: {win32: ["MapleStory2.exe"]}, id: 291, name: "MapleStory 2"},
177
+ {executables: {win32: ["ksp.exe"]}, id: 292, name: "Kerbal Space Program"},
178
+ {executables: {win32: ["PINBALL.EXE"]}, id: 293, name: "3D Pinball: Space Cadet"},
179
+ {executables: {win32: ["dave.exe"]}, id: 294, name: "Dangerous Dave"},
180
+ {executables: {win32: ["iwbtgbeta(slomo).exe", "iwbtgbeta(fs).exe"]}, id: 295, name: "I Wanna Be The Guy"},
181
+ {executables: {win32: ["MechWarriorOnline.exe "]}, id: 296, name: "Mech Warrior Online"},
182
+ {executables: {win32: ["dontstarve_steam.exe"]}, id: 297, name: "Don't Starve"},
183
+ {executables: {win32: ["GalCiv3.exe"]}, id: 298, name: "Galactic Civilization 3"},
184
+ {executables: {win32: ["Risk of Rain.exe"]}, id: 299, name: "Risk of Rain"},
185
+ {executables: {win32: ["Binding_of_Isaac.exe", "Isaac-ng.exe"]}, id: 300, name: "The Binding of Isaac"},
186
+ {executables: {win32: ["RustClient.exe"]}, id: 301, name: "Rust"},
187
+ {executables: {win32: ["Clicker Heroes.exe"]}, id: 302, name: "Clicker Heroes"},
188
+ {executables: {win32: ["Brawlhalla.exe"]}, id: 303, name: "Brawlhalla"},
189
+ {executables: {win32: ["TownOfSalem.exe"]}, id: 304, name: "Town of Salem"},
190
+ {executables: {win32: ["osu!.exe"]}, id: 305, name: "osu!"},
191
+ {executables: {win32: ["PathOfExileSteam.exe", "PathOfExile.exe"]}, id: 306, name: "Path of Exile"},
192
+ {executables: {win32: ["Dolphin.exe"]}, id: 307, name: "Dolphin"},
193
+ {executables: {win32: ["RocketLeague.exe"]}, id: 308, name: "Rocket League"},
194
+ {executables: {win32: ["TJPP.exe"]}, id: 309, name: "Jackbox Party Pack"},
195
+ {executables: {win32: ["KFGame.exe"]}, id: 310, name: "Killing Floor 2"},
196
+ {executables: {win32: ["ShooterGame.exe"]}, id: 311, name: "Ark: Survival Evolved"},
197
+ {executables: {win32: ["LifeIsStrange.exe"]}, id: 312, name: "Life Is Strange"},
198
+ {executables: {win32: ["Client_tos.exe"]}, id: 313, name: "Tree of Savior"},
199
+ {executables: {win32: ["olliolli2.exe"]}, id: 314, name: "OlliOlli2"},
200
+ {executables: {win32: ["cw.exe"]}, id: 315, name: "Closers Dimension Conflict"},
201
+ {executables: {win32: ["ESSTEAM.exe", "elsword.exe", "x2.exe"]}, id: 316, name: "Elsword"},
202
+ {executables: {win32: ["ori.exe"]}, id: 317, name: "Ori and the Blind Forest"},
203
+ {executables: {win32: ["Skyforge.exe"]}, id: 318, name: "Skyforge"},
204
+ {executables: {win32: ["projectzomboid64.exe", "projectzomboid32.exe"]}, id: 319, name: "Project Zomboid"},
205
+ {executables: {win32: ["From_The_Depths.exe"]}, id: 320, name: "The Depths"},
206
+ {executables: {win32: ["TheCrew.exe"]}, id: 321, name: "The Crew"},
207
+ {executables: {win32: ["MarvelHeroes2015.exe"]}, id: 322, name: "Marvel Heroes 2015"},
208
+ {executables: {win32: ["timeclickers.exe"]}, id: 324, name: "Time Clickers"},
209
+ {executables: {win32: ["eurotrucks2.exe"]}, id: 325, name: "Euro Truck Simulator 2"},
210
+ {executables: {win32: ["FarmingSimulator2015Game.exe"]}, id: 326, name: "Farming Simulator 15"},
211
+ {executables: {win32: ["strife.exe"]}, id: 327, name: "Strife"},
212
+ {executables: {win32: ["Awesomenauts.exe"]}, id: 328, name: "Awesomenauts"},
213
+ {executables: {win32: ["Dofus.exe"]}, id: 329, name: "Dofus"},
214
+ {executables: {win32: ["Boid.exe"]}, id: 330, name: "Boid"},
215
+ {executables: {win32: ["adventure-capitalist.exe"]}, id: 331, name: "AdVenture Capitalist"},
216
+ {executables: {win32: ["OrcsMustDie2.exe"]}, id: 332, name: "Orcs Must Die! 2"},
217
+ {executables: {win32: ["Mountain.exe"]}, id: 333, name: "Mountain"},
218
+ {executables: {win32: ["Valkyria.exe"]}, id: 335, name: "Valkyria Chronicles"},
219
+ {executables: {win32: ["ffxiiiimg.exe"]}, id: 336, name: "Final Fantasy XIII"},
220
+ {executables: {win32: ["TLR.exe"]}, id: 337, name: "The Last Remnant"},
221
+ {executables: {win32: ["Cities.exe"]}, id: 339, name: "Cities Skylines"},
222
+ {executables: {win32: ["worldofwarships.exe", "WoWSLauncher.exe"]}, id: 341, name: "World of Warships"},
223
+ {executables: {win32: ["spacegame-Win64-shipping.exe"]}, id: 342, name: "Fractured Space"},
224
+ {executables: {win32: ["thespacegame.exe"]}, id: 343, name: "Ascent - The Space Game"},
225
+ {executables: {win32: ["DuckGame.exe"]}, id: 344, name: "Duck Game"},
226
+ {executables: {win32: ["PPSSPPWindows.exe"]}, id: 345, name: "PPSSPP"},
227
+ {executables: {win32: ["MBAA.exe"]}, id: 346, name: "Melty Blood Actress Again: Current Code"},
228
+ {executables: {win32: ["TheWolfAmongUs.exe"]}, id: 347, name: "The Wolf Among Us"},
229
+ {executables: {win32: ["SpaceEngineers.exe"]}, id: 348, name: "Space Engineers"},
230
+ {executables: {win32: ["Borderlands.exe"]}, id: 349, name: "Borderlands"},
231
+ {executables: {win32: ["100orange.exe"]}, id: 351, name: "100% Orange Juice"},
232
+ {executables: {win32: ["reflex.exe"]}, id: 354, name: "Reflex"},
233
+ {executables: {win32: ["pso2.exe"]}, id: 355, name: "Phantasy Star Online 2"},
234
+ {executables: {win32: ["AssettoCorsa.exe"]}, id: 356, name: "Assetto Corsa"},
235
+ {executables: {win32: ["iw3mp.exe", "iw3sp.exe"]}, id: 357, name: "Call of Duty 4: Modern Warfare"},
236
+ {executables: {win32: ["WolfOldBlood_x64.exe"]}, id: 358, name: "Wolfenstein: The Old Blood"},
237
+ {executables: {win32: ["castle.exe"]}, id: 359, name: "Castle Crashers"},
238
+ {executables: {win32: ["vindictus.exe"]}, id: 360, name: "Vindictus"},
239
+ {executables: {win32: ["ShooterGame-Win32-Shipping.exe"]}, id: 361, name: "Dirty Bomb"},
240
+ {executables: {win32: ["BatmanAK.exe"]}, id: 362, name: "Batman Arkham Knight"},
241
+ {executables: {win32: ["drt.exe"]}, id: 363, name: "Dirt Rally"},
242
+ {executables: {win32: ["rFactor.exe"]}, id: 364, name: "rFactor"},
243
+ {executables: {win32: ["clonk.exe"]}, id: 365, name: "Clonk Rage"},
244
+ {executables: {win32: ["SRHK.exe"]}, id: 366, name: "Shadowrun: Hong Kong"},
245
+ {executables: {win32: ["Insurgency.exe"]}, id: 367, name: "Insurgency"},
246
+ {executables: {win32: ["StepMania.exe"]}, id: 368, name: "Step Mania"},
247
+ {executables: {win32: ["FirefallCLient.exe"]}, id: 369, name: "Firefall"},
248
+ {executables: {win32: ["mirrorsedge.exe"]}, id: 370, name: "Mirrors Edge"},
249
+ {executables: {win32: ["MgsGroundZeroes.exe"]}, id: 371, name: "Metal Gear Solid V: Ground Zeroes"},
250
+ {executables: {win32: ["mgsvtpp.exe"]}, id: 372, name: "Metal Gear Solid V: The Phantom Pain"},
251
+ {executables: {win32: ["tld.exe"]}, id: 373, name: "The Long Dark"},
252
+ {executables: {win32: ["TKOM.exe"]}, id: 374, name: "Take On Mars"},
253
+ {executables: {win32: ["robloxplayerlauncher.exe", "Roblox.exe"]}, id: 375, name: "Roblox"},
254
+ {executables: {win32: ["eu4.exe"]}, id: 376, name: "Europa Universalis 4"},
255
+ {executables: {win32: ["APB.exe"]}, id: 377, name: "APB Reloaded"},
256
+ {executables: {win32: ["Robocraft.exe"]}, id: 378, name: "Robocraft"},
257
+ {executables: {win32: ["Unity.exe"]}, id: 379, name: "Unity"},
258
+ {executables: {win32: ["Simpsons.exe"]}, id: 380, name: "The Simpsons: Hit & Run"},
259
+ {executables: {win32: ["Dnlauncher.exe", "DragonNest.exe"]}, id: 381, name: "Dragon Nest"},
260
+ {executables: {win32: ["Trove.exe"]}, id: 382, name: "Trove"},
261
+ {executables: {win32: ["EndlessLegend.exe"]}, id: 383, name: "Endless Legend"},
262
+ {executables: {win32: ["TurbineLauncher.exe", "dndclient.exe"]}, id: 384, name: "Dungeons & Dragons Online"},
263
+ {executables: {win32: ["quakelive.exe", "quakelive_steam.exe"]}, id: 385, name: "Quake Live"},
264
+ {executables: {win32: ["7DaysToDie.exe"]}, id: 386, name: "7DaysToDie"},
265
+ {executables: {win32: ["SpeedRunners.exe"]}, id: 387, name: "SpeedRunners"},
266
+ {executables: {win32: ["gamemd.exe"]}, id: 388, name: "Command & Conquer: Red Alert 2"},
267
+ {executables: {win32: ["generals.exe"]}, id: 389, name: "Command & Conquer Generals: Zero Hour"},
268
+ {executables: {win32: ["Oblivion.exe"]}, id: 390, name: "The Elder Scrolls 4: Oblivion"},
269
+ {executables: {win32: ["mgsi.exe"]}, id: 391, name: "Metal Gear Solid"},
270
+ {executables: {win32: ["EoCApp.exe"]}, id: 392, name: "Divinity - Original Sin"},
271
+ {executables: {win32: ["Torment.exe"]}, id: 393, name: "Planescape: Torment"},
272
+ {executables: {win32: ["HexPatch.exe"]}, id: 394, name: "Hex: Shards of Fate"},
273
+ {executables: {win32: ["NS3FB.exe"]}, id: 395, name: "Naruto Shippuden Ultimate Ninja Storm 3 Full Burst"},
274
+ {executables: {win32: ["NSUNSR.exe"]}, id: 396, name: "Naruto Shippuden Ultimate Ninja Storm Revolution"},
275
+ {executables: {win32: ["SaintsRowIV.exe"]}, id: 397, name: "Saints Row IV"},
276
+ {executables: {win32: ["Shadowrun.exe"]}, id: 398, name: "Shadowrun"},
277
+ {executables: {win32: ["DungeonoftheEndless.exe"]}, id: 399, name: "Dungeon of the Endless"},
278
+ {executables: {win32: ["Hon.exe"]}, id: 400, name: "Heroes of Newerth"},
279
+ {executables: {win32: ["mabinogi.exe"]}, id: 401, name: "Mabinogi"},
280
+ {executables: {win32: ["CoD2MP_s.exe", "CoDSP_s.exe"]}, id: 402, name: "Call of Duty 2:"},
281
+ {executables: {win32: ["CoDWaWmp.exe", "CoDWaw.exe"]}, id: 403, name: "Call of Duty: World at War"},
282
+ {executables: {win32: ["heroes.exe"]}, id: 404, name: "Mabinogi Heroes (Vindictus) "},
283
+ {executables: {win32: ["KanColleViewer.exe"]}, id: 405, name: "KanColle "},
284
+ {executables: {win32: ["cyphers.exe"]}, id: 406, name: "Cyphers"},
285
+ {executables: {win32: ["RelicCoH2.exe"]}, id: 407, name: "Company of Heroes 2"},
286
+ {executables: {win32: ["MJ.exe"]}, id: 408, name: "セガNET麻雀MJ"},
287
+ {executables: {win32: ["ge.exe"]}, id: 409, name: "Granado Espada"},
288
+ {executables: {win32: ["NovaRO.exe"]}, id: 410, name: "Nova Ragnarok Online"},
289
+ {executables: {win32: ["RivalsofAether.exe"]}, id: 411, name: "Rivals of Aether"},
290
+ {executables: {win32: ["bfh.exe"]}, id: 412, name: "Battlefield Hardline"},
291
+ {executables: {win32: ["GrowHome.exe"]}, id: 413, name: "Grow Home"},
292
+ {executables: {win32: ["patriots.exe"]}, id: 414, name: "Rise of Nations Extended"},
293
+ {executables: {win32: ["Railroads.exe"]}, id: 415, name: "Sid Meier's Railroads!"},
294
+ {executables: {win32: ["Empire.exe"]}, id: 416, name: "Empire: Total War"},
295
+ {executables: {win32: ["Napoleon.exe"]}, id: 417, name: "Napoleon: Total War"},
296
+ {executables: {win32: ["gta_sa.exe"]}, id: 418, name: "Grand Theft Auto: San Andreas"},
297
+ {executables: {win32: ["MadMax.exe"]}, id: 419, name: "Mad Max"},
298
+ {executables: {win32: ["Titanfall.exe"]}, id: 420, name: "Titanfall"},
299
+ {executables: {win32: ["age2_x1.exe"]}, id: 421, name: "Age of Empires II: The Conquerors"},
300
+ {executables: {win32: ["Rome2.exe"]}, id: 422, name: "Total War: ROME 2"},
301
+ {executables: {win32: ["ShadowOfMordor.exe"]}, id: 423, name: "Middle-earth: Shadow of Mordor"},
302
+ {executables: {win32: ["Subnautica.exe"]}, id: 424, name: "Subnautica"},
303
+ {executables: {win32: ["anno5.exe"]}, id: 425, name: "Anno 2070"},
304
+ {executables: {win32: ["carrier.exe"]}, id: 426, name: "Carrier Command Gaea Mission"},
305
+ {executables: {win32: ["DarksidersPC.exe"]}, id: 427, name: "Darksiders"},
306
+ {executables: {win32: ["Darksiders2.exe"]}, id: 428, name: "Darksiders 2"},
307
+ {executables: {win32: ["mudlet.exe"]}, id: 429, name: "Mudlet"},
308
+ {executables: {win32: ["DunDefLauncher.exe"]}, id: 430, name: "Dungeon Defenders II"},
309
+ {executables: {win32: ["hng.exe"]}, id: 431, name: "Heroes and Generals"},
310
+ {executables: {win32: ["WFTOGame.exe"]}, id: 432, name: "War of the Overworld"},
311
+ {executables: {win32: ["Talisman.exe"]}, id: 433, name: "Talisman: Digital Edition"},
312
+ {executables: {win32: ["limbo.exe"]}, id: 434, name: "Limbo"},
313
+ {executables: {win32: ["ibbobb.exe"]}, id: 435, name: "ibb & obb"},
314
+ {executables: {win32: ["BattleBlockTheater.exe"]}, id: 436, name: "BattleBlock Theater"},
315
+ {executables: {win32: ["iracinglauncher.exe", "iracingsim.exe", "iracingsim64.exe"]}, id: 437, name: "iRacing"},
316
+ {executables: {win32: ["CivilizationV_DX11.exe"]}, id: 438, name: "Civilization V"}
317
+ ]
318
+
319
+ @games = @raw_games.map do |hash|
320
+ Game.new(hash)
321
+ end
322
+
323
+ module_function
324
+
325
+ attr_reader :games
326
+
327
+ def find_game(name_or_id)
328
+ return name_or_id if name_or_id.is_a? Game
329
+ @games.each do |game|
330
+ return game if game.name == name_or_id || game.id == name_or_id || game.id.to_s == name_or_id
331
+ end
332
+ nil
333
+ end
334
+ end
@@ -1,3 +1,3 @@
1
1
  module Discordrb
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discordrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - meew0
@@ -106,7 +106,6 @@ files:
106
106
  - lib/discordrb/commands/events.rb
107
107
  - lib/discordrb/commands/parser.rb
108
108
  - lib/discordrb/data.rb
109
- - lib/discordrb/endpoints/endpoints.rb
110
109
  - lib/discordrb/events/channel-create.rb
111
110
  - lib/discordrb/events/channel-delete.rb
112
111
  - lib/discordrb/events/channel-update.rb
@@ -121,6 +120,7 @@ files:
121
120
  - lib/discordrb/events/typing.rb
122
121
  - lib/discordrb/events/voice-state-update.rb
123
122
  - lib/discordrb/exceptions.rb
123
+ - lib/discordrb/games.rb
124
124
  - lib/discordrb/permissions.rb
125
125
  - lib/discordrb/version.rb
126
126
  homepage: https://github.com/meew0/discordrb
@@ -1,16 +0,0 @@
1
- module Discordrb::Endpoints
2
- BASE = "https://discordapp.com/"
3
- APIBASE = BASE + "api"
4
-
5
- #WEBSOCKET_HUB = "wss://discordapp.com/hub"
6
- GATEWAY = APIBASE + "/gateway"
7
-
8
- LOGIN = APIBASE + "/auth/login"
9
- LOGOUT = APIBASE + "/auth/logout"
10
-
11
- SERVERS = APIBASE + "/guilds"
12
-
13
- CHANNELS = APIBASE + "/channels"
14
-
15
- USERS = APIBASE + "/users"
16
- end