因此,我想向我的bot添加一个bug报告命令,这是我的代码:
@client.command()
async def bug(ctx):
guild = ctx.message.guild
BugChannel = await guild.create_text_channel(f'bugreport {ctx.author.name}')
await ctx.send(f'{ctx.author.mention} Describe your Bug in <#{BugChannel.id}>')
我希望只有作者和具有特定角色的ppl才能查看BugChannel
您可以创建具有权限的文本频道。
你可以在Docs中阅读更多关于它的信息
举个例子,它是:
所以dict的键是aRole或aUser和值aPermissionOverwrite
您还应该只使用
ctx.guild
insetad ofctx.message.guild
相关问题 更多 >
编程相关推荐