Db Update and bug fixes
Showing
2 changed files
with
14 additions
and
8 deletions
No preview for this file type
... | @@ -406,7 +406,11 @@ def do_games(client, message_parts, message): | ... | @@ -406,7 +406,11 @@ def do_games(client, message_parts, message): |
406 | games = ', '.join(games_list) | 406 | games = ', '.join(games_list) |
407 | games = games.replace("FINAL FANTASY XIV", "**FINAL FANTASY XIV**") | 407 | games = games.replace("FINAL FANTASY XIV", "**FINAL FANTASY XIV**") |
408 | log(byteify(games)) | 408 | log(byteify(games)) |
409 | send_message(client, message.channel, 'I have seen {} playing: {}'.format(byteify(username), byteify(games))) | 409 | out_string = byteify(games) |
410 | while len(out_string) > 0: | ||
411 | send_message(client, message.channel, out_string[:1900]) | ||
412 | out_string = out_string[1900:] | ||
413 | #send_message(client, message.channel, 'I have seen {} playing: {}'.format(byteify(username), byteify(games))) | ||
410 | else: | 414 | else: |
411 | send_message(client, message.channel, 'I don\'t have any data on {} yet {}'.format(byteify(username), message.author.mention())) | 415 | send_message(client, message.channel, 'I don\'t have any data on {} yet {}'.format(byteify(username), message.author.mention())) |
412 | 416 | ||
... | @@ -1452,7 +1456,9 @@ def thread_exception_handler(method, client, message_parts, message): | ... | @@ -1452,7 +1456,9 @@ def thread_exception_handler(method, client, message_parts, message): |
1452 | else: | 1456 | else: |
1453 | globals()[method](client) | 1457 | globals()[method](client) |
1454 | except Exception as e: | 1458 | except Exception as e: |
1455 | log("{} - {}".format(format_exception(e), e.message)) | 1459 | error_message = "{} - {}".format(format_exception(e), e.message) |
1460 | message_bot_owner("Exception: {}".format(error_message)) | ||
1461 | log(error_message) | ||
1456 | 1462 | ||
1457 | 1463 | ||
1458 | ################# | 1464 | ################# |
... | @@ -1506,6 +1512,11 @@ def on_message(message): | ... | @@ -1506,6 +1512,11 @@ def on_message(message): |
1506 | questions = message.content[len(client.user.name)+1:].replace('?', '').split(' or ') | 1512 | questions = message.content[len(client.user.name)+1:].replace('?', '').split(' or ') |
1507 | send_message(client, message.channel, '{} I choose: {}'.format(message.author.mention(), random.choice(questions).encode('utf-8', errors='ignore'))) | 1513 | send_message(client, message.channel, '{} I choose: {}'.format(message.author.mention(), random.choice(questions).encode('utf-8', errors='ignore'))) |
1508 | 1514 | ||
1515 | def message_bot_owner(message): | ||
1516 | for member in client.get_all_members(): | ||
1517 | if member.id == '78767557628133376': | ||
1518 | send_message(client, member, message) | ||
1519 | break | ||
1509 | 1520 | ||
1510 | @client.event | 1521 | @client.event |
1511 | def on_ready(): | 1522 | def on_ready(): |
... | @@ -1513,12 +1524,7 @@ def on_ready(): | ... | @@ -1513,12 +1524,7 @@ def on_ready(): |
1513 | log(client.user.name) | 1524 | log(client.user.name) |
1514 | log(client.user.id) | 1525 | log(client.user.id) |
1515 | log('------') | 1526 | log('------') |
1516 | for member in client.get_all_members(): | 1527 | message_bot_owner("Bot Started.") |
1517 | if member.id == '78767557628133376': | ||
1518 | send_message(client, member, "Bot Started") | ||
1519 | break | ||
1520 | # for channel in client.get_all_channels(): | ||
1521 | # client.send_message(member, "Bot Started {} {}".format(channel.id, channel.name)) | ||
1522 | 1528 | ||
1523 | check_msg_queue(client) | 1529 | check_msg_queue(client) |
1524 | 1530 | ... | ... |
-
Please register or sign in to post a comment