Added commands I think

This commit is contained in:
JustMaffie 2017-05-28 00:08:33 +02:00
parent 7ea167afcf
commit 13b2aade5e

View File

@ -13,18 +13,6 @@ logging.getLogger('sqlalchemy')
bot = commands.Bot(command_prefix=config['command-prefix'])
database = DatabaseInterface(bot)
def run(self):
try:
bot.loop.run_until_complete(self.start(config["bot-token"]))
except discord.errors.LoginFailure:
print("Invalid bot token in config!")
finally:
try:
self._cleanup()
except Exception as e:
print("Error in cleanup:", e)
bot.loop.close()
def _cleanup(self):
try:
bot.loop.run_until_complete(self.logout())
@ -198,4 +186,15 @@ async def kick(ctx, self):
username = content[2][:content[2].find("#")] if "#" in content[2] else content[2]
discriminator = int(content[2][content[2].find("#") + 1:]) if "#" in content[2] else None
reason = await self.database.revoke_unauth_user_by_query(message.server.id, username, discriminator)
await self.send_message(message.channel, message.author.mention + " " + reason)
await self.send_message(message.channel, message.author.mention + " " + reason)
try:
bot.loop.run_until_complete(bot.run(config["bot-token"]))
except discord.errors.LoginFailure:
print("Invalid bot token in config!")
finally:
try:
self._cleanup()
except Exception as e:
print("Error in cleanup:", e)
bot.loop.close()