def instinct(self, ctx):
server = ctx.message.server
user = ctx.message.author
roles = [role.name.replace('@', '@\u200b') for role in user.roles]
if 'Instinct' in roles:
await self.bot.say("You already joined that team!")
elif 'Mystic' in roles or 'Valor' in roles:
await self.bot.say("You have already joined a team please leave a team before adding a new one")
else:
serverroles = [role.name.replace('@', '@\u200b') for role in server.roles]
if 'Mystic' in serverroles and 'Valor' in serverroles and 'Instinct' in serverroles:
instinct = discord.utils.find(lambda r: r.name == 'Instinct', ctx.message.server.roles)
await self.bot.add_roles(user, instinct)
await self.bot.say("Team succesfuly joined! :+1:")
else:
await self.bot.say("No roles found, creating them now.... ")
valor = await self.bot.create_role(ctx.message.server)
mystic = await self.bot.create_role(ctx.message.server)
instinct = await self.bot.create_role(ctx.message.server)
await self.bot.edit_role(ctx.message.server, valor, name='Valor', colour=discord.Colour(value=15995914))
await self.bot.edit_role(ctx.message.server, mystic, name='Mystic', colour=discord.Colour(value=423919))
await self.bot.edit_role(ctx.message.server, instinct, name='Instinct', colour=discord.Colour(value=16501507))
评论列表
文章目录