3e8d89c6 by Barry

Added rolling and some cleanup.

Added mute (shutup) for vids, images, gifs.
1 parent 468100b5
1 {"<@47934670406422528>": {"<@78767557628133376>": {"delivery_time": "2015/12/25 00:00:00", "message": "Merry Fucking Christmas You Asian Jew", "user_id": "47934670406422528", "channel": "47934985176354816"}}, "<@48148712194576384>": {"<@121404665727418368>": {"delivery_time": "2019/02/03 02:38:24", "message": "u gay", "user_id": "48148712194576384", "channel": "47934985176354816"}}, "<@49237234515181568>": {"<@47934670406422528>": {"delivery_time": "2047/08/11 18:39:12", "message": "ur a fgt", "user_id": "49237234515181568", "channel": "47934985176354816"}}, "<@78767557628133376>": {"<@78767557628133376>": {"delivery_time": "2015/12/22 00:00:00", "message": "happy birthday eli", "user_id": "78767557628133376", "channel": "121370073465094146"}}, "<@121404665727418368>": {"<@47934670406422528>": {"delivery_time": "2016/12/02 16:54:33", "message": "I'm gay.", "user_id": "121404665727418368", "channel": "47934985176354816"}}, "<@63649222993391616>": {"<@121404665727418368>": {"delivery_time": "2015/12/10 16:57:52", "message": "fuck off spic", "user_id": "63649222993391616", "channel": "47934985176354816"}}}
...\ No newline at end of file ...\ No newline at end of file
1 {"<@49237234515181568>": {"<@47934670406422528>": {"delivery_time": "2047/08/11 18:39:12", "message": "ur a fgt", "user_id": "49237234515181568", "channel": "47934985176354816"}}, "<@121404665727418368>": {"<@47934670406422528>": {"delivery_time": "2016/12/02 16:54:33", "message": "I'm gay.", "user_id": "121404665727418368", "channel": "47934985176354816"}}, "<@63649222993391616>": {"<@121404665727418368>": {"delivery_time": "2015/12/10 16:57:52", "message": "fuck off spic", "user_id": "63649222993391616", "channel": "47934985176354816"}}, "<@48148712194576384>": {"<@121404665727418368>": {"delivery_time": "2019/02/03 02:38:24", "message": "u gay", "user_id": "48148712194576384", "channel": "47934985176354816"}}, "<@78767557628133376>": {"<@78767557628133376>": {"delivery_time": "2015/12/22 00:00:00", "message": "happy birthday eli", "user_id": "78767557628133376", "channel": "121370073465094146"}}}
...\ No newline at end of file ...\ No newline at end of file
......
1 ["あなたのガールフレンドは、あなたの後ろの大きな黒い男とセックスを持っているし、それは非常に楽しんでいます。あなたは3年後、彼女はあなたが仕事であったが、それは毎日起こっている明らかにし、その時点でアウトになるまで見つけることができません。あなたはそこに彼女のためにされていないことをお詫びし、あなたと結婚するために彼女をお願いします。 wwwwwww", "Your future is looking grim, consider purchasing Fallout 4™", "あなたのガールフレンドは、あなたの後ろの大きな黒い男とセックスを持っているし、それは非常に楽しんでいます。あなたは3年後、彼女はあなたが仕事であったが、それは毎日起こっている明らかにし、その時点でアウトになるまで見つけることができません。あなたはそこに彼女のためにされていないことをお詫びし、あなたと結婚するために彼女をお願いします。 wwwwwww", "You are being cucked as you are reading this.", "In a world of immigration, censorship and equality... You are being cucked.", "Bright future, white future.", "Fortune Not Found: Abort, Retry, Ignore?", "Now would be a good time to get cucked.", "Come back later... I am sleeping.", "http://cdn.memegenerator.net/instances/400x/12009294.jpg", "Your Allagan Cane will drop next run.", "Your Allagan Cane will never drop.", "http://puu.sh/lFYCG/7f0cfb0004.jpg", "You could not be less interesting, but you are going to keep trying -- right?", "Xorfos will get his Dreadwyrm Axe someday.", "Reminder that Rui never beat Turn 13.", "Fallout 4 will win TGA 2015", "You will get a big fat futa cock up your ass soon.", "Your current problems will only get worse.", "Your cuck shed will see lots of activity in the near future.", "To do great things is difficult; but for you, it is impossible.", "When people tell you that you can't do something, they are probably right.", "There are now 23 nicknames going around for you; None of them are flattering. Tonight you're getting another one.", "Undertale will win TGA 2015", "You are going to develop http://puu.sh/lGFdS/71d497e8e8.gif", "You will go blind and your penis will shrivel by next week, but all can be prevented by inviting your friends & family to use Discord!", "Fortune smiles upon you! Goshzilla will be receiving his BBC into his ass shortly -- AND YOU GOT FRONT ROW SEAT.", "Miss Fortune demands that you play this http://store.steampowered.com/app/418010/", "Everything will be fire.", "Good bombings and many refugees will come to you but only if you post \"HILLARY 2016\" in this chat.", "You will marry 3dpd and have many ugly children. http://i.imgur.com/uNSz7B7.jpg"]
...\ No newline at end of file ...\ No newline at end of file
1 ["あなたのガールフレンドは、あなたの後ろの大きな黒い男とセックスを持っているし、それは非常に楽しんでいます。あなたは3年後、彼女はあなたが仕事であったが、それは毎日起こっている明らかにし、その時点でアウトになるまで見つけることができません。あなたはそこに彼女のためにされていないことをお詫びし、あなたと結婚するために彼女をお願いします。 wwwwwww", "Your future is looking grim, consider purchasing Fallout 4™", "あなたのガールフレンドは、あなたの後ろの大きな黒い男とセックスを持っているし、それは非常に楽しんでいます。あなたは3年後、彼女はあなたが仕事であったが、それは毎日起こっている明らかにし、その時点でアウトになるまで見つけることができません。あなたはそこに彼女のためにされていないことをお詫びし、あなたと結婚するために彼女をお願いします。 wwwwwww", "You are being cucked as you are reading this.", "In a world of immigration, censorship and equality... You are being cucked.", "Bright future, white future.", "Fortune Not Found: Abort, Retry, Ignore?", "Now would be a good time to get cucked.", "Come back later... I am sleeping.", "http://cdn.memegenerator.net/instances/400x/12009294.jpg", "Your Allagan Cane will drop next run.", "Your Allagan Cane will never drop.", "http://puu.sh/lFYCG/7f0cfb0004.jpg", "You could not be less interesting, but you are going to keep trying -- right?", "Xorfos will get his Dreadwyrm Axe someday.", "Reminder that Rui never beat Turn 13.", "Fallout 4 will win TGA 2015", "You will get a big fat futa cock up your ass soon.", "Your current problems will only get worse.", "Your cuck shed will see lots of activity in the near future.", "To do great things is difficult; but for you, it is impossible.", "When people tell you that you can't do something, they are probably right.", "There are now 23 nicknames going around for you; None of them are flattering. Tonight you're getting another one.", "Undertale will win TGA 2015", "You are going to develop http://puu.sh/lGFdS/71d497e8e8.gif", "You will go blind and your penis will shrivel by next week, but all can be prevented by inviting your friends & family to use Discord!", "Fortune smiles upon you! Goshzilla will be receiving his BBC into his ass shortly -- AND YOU GOT FRONT ROW SEAT.", "Miss Fortune demands that you play this http://store.steampowered.com/app/418010/", "Everything will be fire.", "Good bombings and many refugees will come to you but only if you post \"HILLARY 2016\" in this chat.", "You will marry 3dpd and have many ugly children. http://i.imgur.com/uNSz7B7.jpg", "I foresee fapping in your near future! http://puu.sh/lHdZn/aa737a5846.jpg", "I foresee fapping in your near future! http://puu.sh/lHdZn/aa737a5846.jpg"]
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -17,6 +17,8 @@ fortune_file = 'fortunes.json' ...@@ -17,6 +17,8 @@ fortune_file = 'fortunes.json'
17 games_file = 'games.json' 17 games_file = 'games.json'
18 credentials = 'creds.json' 18 credentials = 'creds.json'
19 19
20 muted_until = datetime.datetime.now()
21
20 client = discord.Client() 22 client = discord.Client()
21 23
22 json_data=open(credentials).read() 24 json_data=open(credentials).read()
...@@ -204,6 +206,7 @@ def on_message(message): ...@@ -204,6 +206,7 @@ def on_message(message):
204 print message.content 206 print message.content
205 print message.author 207 print message.author
206 print client.user 208 print client.user
209 global muted_until
207 # we do not want the bot to reply to itself 210 # we do not want the bot to reply to itself
208 if message.author == client.user: 211 if message.author == client.user:
209 return 212 return
...@@ -219,22 +222,30 @@ def on_message(message): ...@@ -219,22 +222,30 @@ def on_message(message):
219 client.send_message(message.channel, 222 client.send_message(message.channel,
220 """{} Available Commands: 223 """{} Available Commands:
221 You can ask compound or questions and I will choose. Example: HellsBot Rui is a Faggot or Rui is a faggot? 224 You can ask compound or questions and I will choose. Example: HellsBot Rui is a Faggot or Rui is a faggot?
225
226 User Info:
222 !aliases - Returns a list of all aliases a user has set for themselves. 227 !aliases - Returns a list of all aliases a user has set for themselves.
223 !addalias <alias> - Adds an alias to your list of aliases. 228 !addalias <alias> - Adds an alias to your list of aliases.
229 !lastseen <username> - Returns info on when the user was last seen and their status.
230 Messages:
224 !msg <username> in 5 minutes Tea is ready 231 !msg <username> in 5 minutes Tea is ready
225 !msg <username> in 45 seconds Your finished masterbating 232 !msg <username> in 45 seconds Your finished masterbating
226 !msg <username> in 2 hours The movie is over 233 !msg <username> in 2 hours The movie is over
227 !msg <username> on 12/22/2015 Happy Birthday! 234 !msg <username> on 12/22/2015 Happy Birthday!
235 Games:
228 !games <username> - Returns a list of games played for a username. 236 !games <username> - Returns a list of games played for a username.
229 !gameslist - Returns a list of the top 20 games and the number of people who have played that game. 237 !gameslist - Returns a list of the top 20 games and the number of people who have played that game.
230 !whoplayed <gamename> - Returns a list of players who have played the game. 238 !whoplayed <gamename> - Returns a list of players who have played the game.
231 !lastseen <username> - Returns info on when the user was last seen and their status. 239 Spam:
232 !addfortune <fortune> - Adds a new fortune.
233 !fortune - Returns your fortune.
234 !youtube <search term> - Returns the first video from the search results for the search term. 240 !youtube <search term> - Returns the first video from the search results for the search term.
235 !gif <search term> - Returns the first gif from the search results. 241 !gif <search term> - Returns the first gif from the search results.
236 !image <search term> - Returns the first image from the search results. 242 !image <search term> - Returns the first image from the search results.
243 Stuff:
244 !addfortune <fortune> - Adds a new fortune.
245 !fortune - Returns your fortune.
246 !roll <1d20> - Roll X number of dice of size X. 1d20 returns 1 roll 1-20. 3d6 returns 3 rolls of 1-6 etc...
237 !secret 247 !secret
248 !shutup - disables all image / gif / youtube span for 5 minutes
238 !bemyirlwaifu""".format(message.author.mention())) 249 !bemyirlwaifu""".format(message.author.mention()))
239 return 250 return
240 251
...@@ -266,21 +277,57 @@ You can ask compound or questions and I will choose. Example: HellsBot Rui is a ...@@ -266,21 +277,57 @@ You can ask compound or questions and I will choose. Example: HellsBot Rui is a
266 else: 277 else:
267 client.send_message(message.channel, 'I don\'t have any data on {} yet {}'.format(username, message.author.mention())) 278 client.send_message(message.channel, 'I don\'t have any data on {} yet {}'.format(username, message.author.mention()))
268 279
280 if message.content.startswith('!shutup'):
281 muted_until = datetime.datetime.now() + datetime.timedelta(minutes=5)
282 client.send_message(message.channel, search_youtube(query))
283 return
284
269 if message.content.startswith('!youtube'): 285 if message.content.startswith('!youtube'):
286 if datetime.datetime.now() < muted_until:
287 return
270 query = message.content[9:] 288 query = message.content[9:]
271 client.send_message(message.channel, search_youtube(query)) 289 client.send_message(message.channel, search_youtube(query))
272 return 290 return
273 291
274 if message.content.startswith('!image'): 292 if message.content.startswith('!image'):
293 if datetime.datetime.now() < muted_until:
294 return
275 query = message.content[7:] 295 query = message.content[7:]
276 client.send_message(message.channel, search_google_images(query)) 296 client.send_message(message.channel, search_google_images(query))
277 return 297 return
278 298
279 if message.content.startswith('!gif'): 299 if message.content.startswith('!gif'):
300 if datetime.datetime.now() < muted_until:
301 return
280 query = message.content[7:] 302 query = message.content[7:]
281 client.send_message(message.channel, search_google_images(query, True)) 303 client.send_message(message.channel, search_google_images(query, True))
282 return 304 return
283 305
306 if message.content.startswith('!roll'):
307 request = message.content[6:]
308 count = 1
309 dice = 100
310 if request.strip() != '':
311 if 'd' in request:
312 dice_parts = request.split('d')
313 if len(dice_parts) == 2:
314 if dice_parts[0].isdigit() and dice_parts[1].isdigit():
315 count = int(dice_parts[0])
316 dice = int(dice_parts[1])
317 if count > 100000000000000000:
318 client.send_message(message.channel, '{} stop fucking around with those stupid numbers...'.format(message.author.mention()))
319 return
320
321 if count > 100:
322 client.send_message(message.channel, '{} 100 is the largest number of dice I will roll.'.format(message.author.mention()))
323 return
324 roll_results = []
325 for i in range(count):
326 roll_results.append(random.randint(1,dice))
327 out_string = '{} your roll {}d{}: {} = {}'.format(message.author.mention(), count, dice, '+'.join(str(r) for r in roll_results), sum(roll_results))
328 client.send_message(message.channel, out_string)
329 return
330
284 if message.content.startswith('!gameslist'): 331 if message.content.startswith('!gameslist'):
285 data = None 332 data = None
286 try: 333 try:
......