1
0
Fork 0
mirror of synced 2024-05-19 20:12:30 +12:00

Added courutine functionality for live debugging

This commit is contained in:
phxntxm 2016-07-12 23:30:22 -05:00
parent 9e129fc991
commit 42a3f3f829
2 changed files with 5 additions and 2 deletions

View file

@ -156,7 +156,7 @@ class Core:
return
sql = 'insert into tags (server_id, tag, result) values (%s, %s, %s)'
cursor.execute(sql, (ctx.message.server.id, tag, result))
await self.bot.say("I have just added the tag '{0}'! You can call this tag by entering !tag {0}".format(tag))
await self.bot.say("I have just added the tag `{0}`! You can call this tag by entering !tag {0}".format(tag))
config.closeConnection()
@tag.command(name='delete', aliases=['remove', 'stop'], pass_context=True)
@ -174,7 +174,7 @@ class Core:
config.closeConnection()
return
cursor.execute('delete from tags where server_id=%s and tag=%s', (ctx.message.server.id, tag))
await self.bot.say('I have just removed the tag \'{}\''.format(tag))
await self.bot.say('I have just removed the tag `{}`'.format(tag))
config.closeConnection()

View file

@ -5,6 +5,7 @@ import re
import os
import sys
import discord
import inspect
getter = re.compile(r'`(?!`)(.*?)`')
multi = re.compile(r'```(.*?)```', re.DOTALL)
@ -39,6 +40,8 @@ class Owner:
else:
if not match_multi:
result = eval(match_single[0])
if inspect.isawaitable(result):
result = await result
await self.bot.say("```{0}```".format(result))
else:
def r(v):