![](/img/trans.png)
[英]How can i solve Application Error caused after deploying my model on Heroku using Flask?
[英]How can I solve a TypeError when deploying my Bot to Heroku?
我試圖創建一個播放音樂的機器人。 將其部署到 Heroku 后,出現以下錯誤:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: _hook() takes 2 positional arguments but 3 were given
我嘗試從我的計算機托管機器人,它工作正常。 但是,當我嘗試在 Heroku 上托管它時,它不起作用。
這是我的代碼:
@client.command(pass_context=True, aliases=['j', 'joi'])
async def join(ctx):
channel = ctx.message.author.voice.channel
voice = get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
else:
voice = await channel.connect()
await voice.disconnect()
if voice and voice.is_connected():
await voice.move_to(channel)
else:
await channel.connect()
print(f"The bot has connected to {channel}\n")
await ctx.send(f"Joined {channel}")
如果您要部署音樂 Discord 機器人,Heroku 不是最佳主機,尤其是在您使用 FFMPEG 時。 雖然有辦法,但實施起來需要做很多工作。 我建議使用 Vultr 等 VPN,如果您不想玩,可以使用 PenguinBots 或 ShockNodes。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.