Adding test command to check automatic type hinting
This commit is contained in:
parent
4f6e1b7ea5
commit
571a4295ec
|
@ -174,6 +174,10 @@ class Core:
|
||||||
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()
|
config.closeConnection()
|
||||||
|
|
||||||
|
@commands.command()
|
||||||
|
async def test(self, *, first, second):
|
||||||
|
await self.bot.say("First: {}\nSecond: {}".format(first, second))
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Core(bot))
|
bot.add_cog(Core(bot))
|
||||||
|
|
|
@ -13,17 +13,18 @@ def customPermsOrRole(perm):
|
||||||
cursor.execute('use {}'.format(config.db_perms))
|
cursor.execute('use {}'.format(config.db_perms))
|
||||||
cmd = str(ctx.command)
|
cmd = str(ctx.command)
|
||||||
sid = ctx.message.server.id
|
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.write("cmd: {}\nsid: {}".format(cmd, sid))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
cursor.execute("show tables like %s", (sid,))
|
cursor.execute("show tables like %s", (sid,))
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
if result is not None:
|
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,))
|
cursor.execute(sql, (cmd,))
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
perm = result['perms']
|
if result is not None:
|
||||||
|
perm = result['perms']
|
||||||
if perm == "none":
|
if perm == "none":
|
||||||
return True
|
return True
|
||||||
config.closeConnection()
|
config.closeConnection()
|
||||||
|
@ -31,6 +32,7 @@ def customPermsOrRole(perm):
|
||||||
if getattr(role, perm):
|
if getattr(role, perm):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return commands.check(predicate)
|
return commands.check(predicate)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue