5cf9ae7b by Barry

Db Update and bug fixes

1 parent 58ae79f7
No preview for this file type
......@@ -406,7 +406,11 @@ def do_games(client, message_parts, message):
games = ', '.join(games_list)
games = games.replace("FINAL FANTASY XIV", "**FINAL FANTASY XIV**")
log(byteify(games))
send_message(client, message.channel, 'I have seen {} playing: {}'.format(byteify(username), byteify(games)))
out_string = byteify(games)
while len(out_string) > 0:
send_message(client, message.channel, out_string[:1900])
out_string = out_string[1900:]
#send_message(client, message.channel, 'I have seen {} playing: {}'.format(byteify(username), byteify(games)))
else:
send_message(client, message.channel, 'I don\'t have any data on {} yet {}'.format(byteify(username), message.author.mention()))
......@@ -1452,7 +1456,9 @@ def thread_exception_handler(method, client, message_parts, message):
else:
globals()[method](client)
except Exception as e:
log("{} - {}".format(format_exception(e), e.message))
error_message = "{} - {}".format(format_exception(e), e.message)
message_bot_owner("Exception: {}".format(error_message))
log(error_message)
#################
......@@ -1506,6 +1512,11 @@ def on_message(message):
questions = message.content[len(client.user.name)+1:].replace('?', '').split(' or ')
send_message(client, message.channel, '{} I choose: {}'.format(message.author.mention(), random.choice(questions).encode('utf-8', errors='ignore')))
def message_bot_owner(message):
for member in client.get_all_members():
if member.id == '78767557628133376':
send_message(client, member, message)
break
@client.event
def on_ready():
......@@ -1513,12 +1524,7 @@ def on_ready():
log(client.user.name)
log(client.user.id)
log('------')
for member in client.get_all_members():
if member.id == '78767557628133376':
send_message(client, member, "Bot Started")
break
# for channel in client.get_all_channels():
# client.send_message(member, "Bot Started {} {}".format(channel.id, channel.name))
message_bot_owner("Bot Started.")
check_msg_queue(client)
......