Привет, я хотел бы, чтобы роль людей была упомянута после добавления / удаления в очереди.
Пример:
! Addme
Джо Блоггс из Роли {клан } Был добавлен в очередь
@commands.command(pass_context=True)
async def addme(self, ctx):
''': Add yourself to the queue!'''
author = ctx.message.author
if self.qtoggle:
if author.id not in self.queue:
self.queue.append(author.id)
await ctx.send('you have been added to the Tablet Crafting Queue.')
else:
await ctx.send('you are already in the Tablet Crafting Queue!')
else:
await ctx.send('The Tablet Crafting Queue is closed.')
@commands.command(pass_context=True)
async def removeme(self, ctx):
''': Remove yourself from the queue'''
author = ctx.message.author
if author.id in self.queue:
self.queue.remove(author.id)
await ctx.send('you have been removed from the Tablet Crafting Queue.')
else:
await ctx.send('you were not in the Tablet Crafting Queue.')
@commands.command(name='queue', pass_context=True)
async def _queue(self, ctx):
''': See who's up next!'''
server = ctx.message.guild
message = ''
for place, member_id in enumerate(self.queue):
member = discord.utils.get(server.members, id=member_id)
message += f'**#{place+1}** : {member.mention} : {role.mention}\n'
if message != '':
await ctx.send(message)
else:
await ctx.send('Tablet Crafting Queue is empty')