【发布时间】:2020-08-31 09:45:49
【问题描述】:
好的,所以我将它添加到我的机器人中:
if message.content.startswith('!test'):
voice = await client.join_voice_channel(message.author.voice.voice_channel)
args = message.content.split(" ")
betterargs = " ".join(args[1:])
player = await voice.create_ytdl_player('https://www.youtube.com/watch?v=' + betterargs)
player.start()
但是当我输入 !test 并在聊天中结束 youtube 链接时,机器人会加入频道,但它给了我这个错误
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\server\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "noob.py", line 99, in on_message
voice = await client.join_voice_channel(message.author.voice.voice_channel)
File "C:\Users\server\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 3211, in join_voice_channel
有人知道怎么回事吗?
【问题讨论】:
标签: python discord discord.py