如何使用用户的user_id吸引用户并为其分配通道专有权限

时间:2018-08-18 14:06:31

标签: python discord discord.py

我正在尝试使用他的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

0 个答案:

没有答案