【发布时间】:2020-04-18 18:27:27
【问题描述】:
@Bot.command(pass_context= True)
async def complete(ctx):
guild = ctx.message.guild
id_admin = discord.Role.id=658306078928273408
overwrites = {
id_admin: discord.PermissionOverwrite(send_messages=True),
guild.me: discord.PermissionOverwrite(read_messages=True),
}
await guild.delete_text_channel(discord.TextChannel.name)
我没有在 Discord API 中找到正确的属性。
我应该使用什么属性来删除我编写命令的通道?Error: AttributeError: 'Guild' object has no attribute 'delete_text_channel'
【问题讨论】:
-
除了之前的错误,你需要在一个TextChannel对象discordpy.readthedocs.io/en/latest/…上调用
delete -
@AlbertoPoljak
GuildChannel的任何子类都有其对应的deletemethod。这包括VoiceChannel和CategoryChannel。 -
@Harmon758 和?
delete_text_channel和discord.TextChannel足以暗示我告诉我他正在处理 TextChannel。但是我明白你的意思,尽管我不确定 cmets 是了解细节的最佳场所。这更像是我的暗示。
标签: python python-3.x discord.py