468100b5 by Barry

Added alises to the bot.

1 parent 2639440f
...@@ -319,8 +319,11 @@ You can ask compound or questions and I will choose. Example: HellsBot Rui is a ...@@ -319,8 +319,11 @@ You can ask compound or questions and I will choose. Example: HellsBot Rui is a
319 client.send_message(message.channel, 'I am a bit confused right now.. maybe I need more data. {}!'.format(message.author.mention())) 319 client.send_message(message.channel, 'I am a bit confused right now.. maybe I need more data. {}!'.format(message.author.mention()))
320 else: 320 else:
321 username = message.content[9:].replace('@', '').lower() 321 username = message.content[9:].replace('@', '').lower()
322 if username.strip() == '':
323 client.send_message(message.channel, '{} please provide a username. !aliases <username>'.format(message.author.mention()))
324 return
322 if username in data and 'aliases' in data[username]: 325 if username in data and 'aliases' in data[username]:
323 client.send_message(message.channel, '{} has the following aliases:'.format(username, ', '.join(data[username]['aliases']))) 326 client.send_message(message.channel, '{} has the following aliases: {}'.format(username, ', '.join(data[username]['aliases'])))
324 else: 327 else:
325 client.send_message(message.channel, 'No known alises for {} yet {}'.format(username, message.author.mention())) 328 client.send_message(message.channel, 'No known alises for {} yet {}'.format(username, message.author.mention()))
326 return 329 return
...@@ -341,6 +344,9 @@ You can ask compound or questions and I will choose. Example: HellsBot Rui is a ...@@ -341,6 +344,9 @@ You can ask compound or questions and I will choose. Example: HellsBot Rui is a
341 if 'aliases' not in data[username]: 344 if 'aliases' not in data[username]:
342 data[username]['aliases'] = [] 345 data[username]['aliases'] = []
343 data[username]['aliases'].append(alias) 346 data[username]['aliases'].append(alias)
347 jdata = json.dumps(data, ensure_ascii=False)
348
349 open(member_status, 'wb+').write(jdata.encode('utf8'))
344 client.send_message(message.channel, '{} has been added to your aliases'.format(alias)) 350 client.send_message(message.channel, '{} has been added to your aliases'.format(alias))
345 else: 351 else:
346 client.send_message(message.channel, 'Something horrible happened and it is all your fault.') 352 client.send_message(message.channel, 'Something horrible happened and it is all your fault.')
......
1 {"zan": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:16:46", "mention": "<@65178351664377856>", "prev_status": "idle", "games_played": [], "game_id": null, "afk_at": "2015/12/04 20:59:26", "id": "65178351664377856"}, "solidsteak": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 18:56:22", "mention": "<@62955839694053376>", "prev_status": "idle", "games_played": [248, null, 310, 533], "game_id": null, "afk_at": "2015/12/04 18:38:49", "id": "62955839694053376"}, "apple": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:26:42", "mention": "<@121822410096771072>", "prev_status": "idle", "game_id": 1, "games_played": [1, 6, null], "afk_at": "2015/12/04 21:18:16", "id": "121822410096771072"}, "sheik": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 15:24:28", "mention": "<@48148712194576384>", "prev_status": "idle", "games_played": [283, null], "game_id": null, "afk_at": "2015/12/04 15:19:07", "id": "48148712194576384"}, "puncherboxer": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 04:11:44", "mention": "<@118544498996412416>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 03:48:11", "id": "118544498996412416"}, "rae": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:00:44", "mention": "<@48162082507456512>", "prev_status": "idle", "game_id": null, "games_played": [], "afk_at": "2015/12/04 20:55:58", "id": "48162082507456512"}, "marion": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/03 05:14:48", "prev_status": "online", "games_played": [1, null], "game_id": null, "afk_at": "2015/12/02 08:30:16"}, "shyrith": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/03 08:10:52", "prev_status": "online", "games_played": [1, 644, null], "game_id": null, "afk_at": "2015/12/02 21:54:35"}, "goshzilla": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:36:07", "mention": "<@47934670406422528>", "prev_status": "idle", "game_id": null, "games_played": [3, null], "afk_at": "2015/12/04 20:35:44", "id": "47934670406422528"}, "eeri": {"status": "online", "is_afk": false, "status_change_at": "2015/12/03 17:18:42", "mention": "<@122023217371021313>", "prev_status": "offline", "games_played": [], "game_id": null, "afk_at": "2015/12/03 17:18:42", "id": "122023217371021313"}, "dick": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:26:43", "mention": "<@78767611436863488>", "prev_status": "offline", "games_played": [], "game_id": null, "afk_at": "2015/12/04 13:29:03", "id": "78767611436863488"}, "arka": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 15:48:59", "mention": "<@121466618126532608>", "prev_status": "online", "games_played": [1, null, 313], "game_id": null, "afk_at": "2015/12/04 14:50:01", "id": "121466618126532608"}, "wriggle": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 19:52:13", "mention": "<@80169354666192896>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/02 15:37:49", "id": "80169354666192896"}, "tim": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 10:25:19", "mention": "<@109145030354030592>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 07:08:23", "id": "109145030354030592"}, "charisma": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 14:16:47", "mention": "<@65187139276513280>", "prev_status": "online", "games_played": [313, null], "game_id": null, "afk_at": "2015/12/04 06:17:29", "id": "65187139276513280"}, "mate": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 09:11:30", "mention": "<@109145154044071936>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 05:06:58", "id": "109145154044071936"}, "sig": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 13:15:08", "mention": "<@104055037243707392>", "prev_status": "online", "games_played": [8, null, 7, 466, 588, 15], "game_id": null, "afk_at": "2015/12/04 11:47:44", "id": "104055037243707392"}, "richter": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:37:06", "mention": "<@49237234515181568>", "prev_status": "idle", "games_played": [], "game_id": null, "afk_at": "2015/12/04 20:34:59", "id": "49237234515181568"}, "mr. nelson": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:32:01", "mention": "<@103311664748707840>", "prev_status": "idle", "game_id": null, "games_played": [], "afk_at": "2015/12/04 17:19:50", "id": "103311664748707840"}, "skeletonhorn": {"status": "online", "is_afk": false, "status_change_at": "2015/12/03 00:36:39", "prev_status": "offline", "games_played": [], "game_id": null, "afk_at": "2015/12/03 00:36:39"}, "yoltan": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 17:58:17", "mention": "<@122369674808786948>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 16:14:00", "id": "122369674808786948"}, "rui": {"status": "offline", "mention": "<@63649222993391616>", "is_afk": false, "games_played": [], "game_id": null, "afk_at": "2015/12/03 03:48:05", "status_change_at": "2015/12/04 21:27:41", "id": "63649222993391616", "prev_status": "online"}, "adol": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 20:51:25", "mention": "<@122079633796497409>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 20:51:25", "id": "122079633796497409"}, "roris": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 06:17:50", "mention": "<@80876422352076800>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 01:45:43", "id": "80876422352076800"}, "projectaria": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 18:28:54", "mention": "<@48146724769763328>", "prev_status": "online", "games_played": [1, null], "game_id": null, "afk_at": "2015/12/04 13:17:05", "id": "48146724769763328"}, "moss": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 18:17:37", "mention": "<@48168872238387200>", "prev_status": "offline", "games_played": [0, null, 1, 715, 127], "game_id": null, "afk_at": "2015/12/04 12:49:36", "id": "48168872238387200"}, "master of moisture": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 09:12:41", "mention": "<@112340697771765760>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 08:46:41", "id": "112340697771765760"}, "yobi": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 20:37:26", "mention": "<@65180855919714304>", "prev_status": "online", "game_id": null, "games_played": [3, null, 680], "afk_at": "2015/12/04 20:37:26", "id": "65180855919714304"}, "scoops": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 19:36:57", "mention": "<@65211875771559936>", "prev_status": "idle", "game_id": null, "games_played": [347, null, 0, 644], "afk_at": "2015/12/04 19:32:58", "id": "65211875771559936"}, "study": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 05:45:39", "mention": "<@121821978222002178>", "prev_status": "idle", "games_played": [], "game_id": null, "afk_at": "2015/12/04 05:44:28", "id": "121821978222002178"}, "grey": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 17:42:27", "mention": "<@48120346410221568>", "prev_status": "online", "game_id": null, "games_played": [550, null, 1, 208], "afk_at": "2015/12/04 17:42:27", "id": "48120346410221568"}, "hellsbreath": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:05:08", "mention": "<@78767557628133376>", "prev_status": "idle", "games_played": [326, null, 660, 680, 566], "game_id": null, "afk_at": "2015/12/04 20:58:24", "id": "78767557628133376"}, "green": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:44:27", "mention": "<@63098846506397696>", "prev_status": "offline", "games_played": [4, null], "game_id": 4, "afk_at": "2015/12/04 11:42:34", "id": "63098846506397696"}, "azia": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 20:46:30", "mention": "<@121404665727418368>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 20:46:30", "id": "121404665727418368"}, "xorfos": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 21:19:30", "mention": "<@121019458700443650>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 21:19:30", "id": "121019458700443650"}, "salt": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:12:29", "mention": "<@48140539459010560>", "prev_status": "idle", "games_played": [466, 8, null, 680, 588], "game_id": null, "afk_at": "2015/12/04 20:09:09", "id": "48140539459010560"}, "cae": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 19:21:59", "mention": "<@65178683714830336>", "prev_status": "idle", "game_id": null, "games_played": [335, null], "afk_at": "2015/12/04 19:17:49", "id": "65178683714830336"}}
...\ No newline at end of file ...\ No newline at end of file
1 {"zan": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:16:46", "mention": "<@65178351664377856>", "prev_status": "idle", "game_id": null, "games_played": [], "afk_at": "2015/12/04 20:59:26", "id": "65178351664377856"}, "solidsteak": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 18:56:22", "mention": "<@62955839694053376>", "prev_status": "idle", "game_id": null, "games_played": [248, null, 310, 533], "afk_at": "2015/12/04 18:38:49", "id": "62955839694053376"}, "apple": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:26:42", "mention": "<@121822410096771072>", "prev_status": "idle", "games_played": [1, 6, null], "game_id": 1, "afk_at": "2015/12/04 21:18:16", "id": "121822410096771072"}, "sheik": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 15:24:28", "mention": "<@48148712194576384>", "prev_status": "idle", "game_id": null, "games_played": [283, null], "afk_at": "2015/12/04 15:19:07", "id": "48148712194576384", "aliases": ["Sheik Innit", "Aiden Ren"]}, "puncherboxer": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 04:11:44", "mention": "<@118544498996412416>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 03:48:11", "id": "118544498996412416"}, "rae": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:00:44", "mention": "<@48162082507456512>", "prev_status": "idle", "games_played": [], "game_id": null, "afk_at": "2015/12/04 20:55:58", "id": "48162082507456512"}, "marion": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/03 05:14:48", "prev_status": "online", "games_played": [1, null], "game_id": null, "afk_at": "2015/12/02 08:30:16"}, "shyrith": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/03 08:10:52", "prev_status": "online", "games_played": [1, 644, null], "game_id": null, "afk_at": "2015/12/02 21:54:35"}, "goshzilla": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:36:07", "mention": "<@47934670406422528>", "prev_status": "idle", "games_played": [3, null], "game_id": null, "afk_at": "2015/12/04 20:35:44", "id": "47934670406422528", "aliases": ["Goshzilla", "Goshzilla Qongo", "Gawshzilla", "Gollyzilla", "Goshdarnit"]}, "eeri": {"status": "online", "is_afk": false, "status_change_at": "2015/12/03 17:18:42", "mention": "<@122023217371021313>", "prev_status": "offline", "game_id": null, "games_played": [], "afk_at": "2015/12/03 17:18:42", "id": "122023217371021313"}, "dick": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 21:36:02", "mention": "<@78767611436863488>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 21:36:02", "id": "78767611436863488", "aliases": []}, "arka": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 15:48:59", "mention": "<@121466618126532608>", "prev_status": "online", "game_id": null, "games_played": [1, null, 313], "afk_at": "2015/12/04 14:50:01", "id": "121466618126532608"}, "wriggle": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 19:52:13", "mention": "<@80169354666192896>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/02 15:37:49", "id": "80169354666192896"}, "tim": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 10:25:19", "mention": "<@109145030354030592>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 07:08:23", "id": "109145030354030592"}, "charisma": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 14:16:47", "mention": "<@65187139276513280>", "prev_status": "online", "game_id": null, "games_played": [313, null], "afk_at": "2015/12/04 06:17:29", "id": "65187139276513280"}, "mate": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 09:11:30", "mention": "<@109145154044071936>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 05:06:58", "id": "109145154044071936"}, "sig": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 13:15:08", "mention": "<@104055037243707392>", "prev_status": "online", "game_id": null, "games_played": [8, null, 7, 466, 588, 15], "afk_at": "2015/12/04 11:47:44", "id": "104055037243707392"}, "mr. nelson": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 21:35:23", "mention": "<@103311664748707840>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 21:35:23", "id": "103311664748707840", "aliases": []}, "skeletonhorn": {"status": "online", "is_afk": false, "status_change_at": "2015/12/03 00:36:39", "prev_status": "offline", "games_played": [], "game_id": null, "afk_at": "2015/12/03 00:36:39"}, "yoltan": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 17:58:17", "mention": "<@122369674808786948>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 16:14:00", "id": "122369674808786948"}, "rui": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 21:27:41", "mention": "<@63649222993391616>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/03 03:48:05", "id": "63649222993391616"}, "adol": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 20:51:25", "mention": "<@122079633796497409>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 20:51:25", "id": "122079633796497409"}, "xorfos": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 21:39:30", "mention": "<@121019458700443650>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 21:39:30", "id": "121019458700443650", "aliases": []}, "roris": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 06:17:50", "mention": "<@80876422352076800>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 01:45:43", "id": "80876422352076800"}, "projectaria": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 18:28:54", "mention": "<@48146724769763328>", "prev_status": "online", "game_id": null, "games_played": [1, null], "afk_at": "2015/12/04 13:17:05", "id": "48146724769763328"}, "moss": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 18:17:37", "mention": "<@48168872238387200>", "prev_status": "offline", "game_id": null, "games_played": [0, null, 1, 715, 127], "afk_at": "2015/12/04 12:49:36", "id": "48168872238387200"}, "master of moisture": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 09:12:41", "mention": "<@112340697771765760>", "prev_status": "online", "game_id": null, "games_played": [], "afk_at": "2015/12/04 08:46:41", "id": "112340697771765760"}, "yobi": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 20:37:26", "mention": "<@65180855919714304>", "prev_status": "online", "games_played": [3, null, 680], "game_id": null, "afk_at": "2015/12/04 20:37:26", "id": "65180855919714304"}, "salt": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:12:29", "mention": "<@48140539459010560>", "prev_status": "idle", "game_id": null, "games_played": [466, 8, null, 680, 588], "afk_at": "2015/12/04 20:09:09", "id": "48140539459010560"}, "study": {"status": "offline", "is_afk": false, "status_change_at": "2015/12/04 05:45:39", "mention": "<@121821978222002178>", "prev_status": "idle", "game_id": null, "games_played": [], "afk_at": "2015/12/04 05:44:28", "id": "121821978222002178"}, "grey": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 17:42:27", "mention": "<@48120346410221568>", "prev_status": "online", "games_played": [550, null, 1, 208], "game_id": null, "afk_at": "2015/12/04 17:42:27", "id": "48120346410221568"}, "hellsbreath": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 21:05:08", "mention": "<@78767557628133376>", "prev_status": "idle", "game_id": null, "games_played": [326, null, 660, 680, 566], "afk_at": "2015/12/04 20:58:24", "id": "78767557628133376", "aliases": ["Barry", "Ben Killin"]}, "green": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:44:27", "mention": "<@63098846506397696>", "prev_status": "offline", "game_id": 4, "games_played": [4, null], "afk_at": "2015/12/04 11:42:34", "id": "63098846506397696"}, "azia": {"status": "idle", "is_afk": true, "status_change_at": "2015/12/04 20:46:30", "mention": "<@121404665727418368>", "prev_status": "online", "games_played": [], "game_id": null, "afk_at": "2015/12/04 20:46:30", "id": "121404665727418368"}, "scoops": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 19:36:57", "mention": "<@65211875771559936>", "prev_status": "idle", "games_played": [347, null, 0, 644], "game_id": null, "afk_at": "2015/12/04 19:32:58", "id": "65211875771559936"}, "richter": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 20:37:06", "mention": "<@49237234515181568>", "prev_status": "idle", "game_id": null, "games_played": [], "afk_at": "2015/12/04 20:34:59", "id": "49237234515181568"}, "cae": {"status": "online", "is_afk": false, "status_change_at": "2015/12/04 19:21:59", "mention": "<@65178683714830336>", "prev_status": "idle", "games_played": [335, null], "game_id": null, "afk_at": "2015/12/04 19:17:49", "id": "65178683714830336"}}
...\ No newline at end of file ...\ No newline at end of file
......