邮政编码:
import discord
import youtube_dl
from discord.ext import commands
client = commands.Bot(command_prefix = "e!")
players = {}
@client.event
async def on_ready():
print("Bot çevrimiçi!")
@client.command(pass_context = True)
async def baglan(ctx):
channel = ctx.message.author.voice.voice_channel
await client.join_voice_channel(channel)
@client.command(pass_context = True)
async def oynat(ctx, url):
server = ctx.message.server
voice_client = client.voice_client_in(server)
player = await voice_client.create_ytdl_player(url)
players[server.id] = player
player.start()
client.run('')
错误:
packages/discord/ext/commands/core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'create_ytdl_player'
该机器人通常在我自己的PC上运行,但是我当前在Heroku
服务器上运行。该漫游器加入了频道,但不播放音频。
我不知道如何解决这个问题 预先感谢您的帮助。