如何修改特定频道的用户权限 nextcord

问题描述 投票:0回答:1

我想创建一个只有我和编写命令的人可以发送消息的通道。 到目前为止我有这个代码:

@commands.command()
    async def ticket(self, ctx, title, context):
        guild = ctx.guild
        member = ctx.author.name
        role = ctx.author.id
        category = guild.get_channel(1175421519439073380)
        channel = await category.create_text_channel(f'{member}-ticket')
        channel_id = channel.id
        getch = guild.get_channel(channel_id)
        if getch:
            embed = nextcord.Embed(
                title=title,
                description="<@&1146194171422572644> and <@696415634359189516> \n" + context,
                color=nextcord.Colour.green()
            )
            await channel.send(embed=embed)

我不知道如何让我和用户看到该频道。

discord discord.py nextcord
1个回答
0
投票

我可能会迟到,但也许你还需要这个。

channel_id.set_permissions(member, permission=TrueOrFalse)

您可以在此处找到权限列表:权限

© www.soinside.com 2019 - 2024. All rights reserved.