Added courutine functionality for live debugging
This commit is contained in:
parent
9e129fc991
commit
42a3f3f829
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue