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

Adding test command to check automatic type hinting

This commit is contained in:
phxntxm 2016-07-15 16:51:28 -05:00
parent 4f6e1b7ea5
commit 571a4295ec
2 changed files with 10 additions and 4 deletions

View file

@ -174,6 +174,10 @@ class Core:
await self.bot.say('I have just removed the tag `{}`'.format(tag))
config.closeConnection()
@commands.command()
async def test(self, *, first, second):
await self.bot.say("First: {}\nSecond: {}".format(first, second))
def setup(bot):
bot.add_cog(Core(bot))

View file

@ -13,17 +13,18 @@ def customPermsOrRole(perm):
cursor.execute('use {}'.format(config.db_perms))
cmd = str(ctx.command)
sid = ctx.message.server.id
f = open("/home/phxntx5/public_html/Bonfire/checkstest.txt","r+")
f = open("/home/phxntx5/public_html/Bonfire/checkstest.txt", "r+")
f.write("cmd: {}\nsid: {}".format(cmd, sid))
f.close()
cursor.execute("show tables like %s", (sid,))
result = cursor.fetchone()
if result is not None:
sql = "select perms from `"+sid+"` where command=%s"
sql = "select perms from `" + sid + "` where command=%s"
cursor.execute(sql, (cmd,))
result = cursor.fetchone()
perm = result['perms']
if result is not None:
perm = result['perms']
if perm == "none":
return True
config.closeConnection()
@ -31,6 +32,7 @@ def customPermsOrRole(perm):
if getattr(role, perm):
return True
return False
return commands.check(predicate)