我正在尝试使用他的ID或用户名来吸引用户,并为他分配频道独占权限。 这是我尝试过的:
role = discord.utils.get(server.roles, name="Tech Support Lead")
user = self.bot.get_user_info(tickets[ticket]["ticket_data"][0][u'issuer_id'])
ticket_perms = discord.PermissionOverwrite(read_messages=True)
everyone_perms = discord.PermissionOverwrite(read_messages=False)
techlead = discord.ChannelPermissions(target=role, overwrite=ticket_perms)
everyone = discord.ChannelPermissions(target=server.default_role, overwrite=everyone_perms)
ticket = discord.ChannelPermissions(target=user, overwrite=ticket_perms)
await self.bot.create_channel(server, "Ticket Nr. {}".format(ticket), everyone, claimer, techlead)
运行此代码时,出现错误HTTPException - Bad Request
。