Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def addblacklist(message):
- isadmin0 = await isadmin(message.author)
- if isadmin0 == True:
- arguments = message.content.split()
- target = discord.utils.find(lambda m: m.mention == arguments[1], message.channel.server.members)
- isblacklisted = await isblacklist(target)
- if isblacklisted == False:
- connection = await aiomysql.connect(host=str(mysql_host),user=str(mysql_user),password=str(mysql_passwd), db=str(mysql_db), charset='utf8mb4')
- async with connection.cursor(aiomysql.cursors.DictCursor) as cur:
- sql = "INSERT INTO `blacklist` (`discordid`) VALUES ('" + target.id + "');"
- await cur.execute(sql)
- await connection.commit()
- connection.close()
- await client.send_message(message.channel, str(target) + " est maintenant blacklisté")
- return
- else:
- embed=discord.Embed(title="Blacklist", description=str(target) + " est deja blacklisté", color=0xff0000)
- await client.send_message(message.channel, embed=embed)
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement