【发布时间】:2019-01-13 07:28:08
【问题描述】:
我已经在网上搜索了很多关于此的内容。在那里我遇到了 API Refrence (https://discordpy.readthedocs.io/en/rewrite/api.html#discord.TextChannel),它帮助我找到了我需要使用的命令。所以我的结论是使用这个代码:
channel = client.get_channel(475772135730708480)
@client.command()
async def emoivb(ctx):
await discord.VoiceChannel.edit(channel, name = "test")
问题是它不能解决这个错误:
File "C:/Users/MyUser/Desktop/discordbot.py", line 25, in emoivb
await discord.VoiceChannel.edit(channel, name = "test")
所以这个错误根本没有帮助我......但我确定我只是没有正确理解 API 引用并且没有使用应该使用的命令。我对 python 编码很陌生,所以这是最有可能发生的事情。 如果有人有更多的python知识并且能够理解我做错了什么,我将非常感谢您的帮助! :)
【问题讨论】:
-
完整的错误信息是什么?它可能会告诉您
channel是TextChannel而不是VoiceChannel。出于这个原因,你应该只是做channel.edit(name='test')。你可能会受益于做一些更一般的 Python 阅读,比如Python Tutorial
标签: python python-3.x discord discord.py