问题
I've deployed a Discord bot(discord.py) with heroku. The status of the bot is "online" in the Heroku's Dashboard however the bot is offline in Discord.I've added the Procfile and enabled the dyno in resources. Is there anything else i have to do??
EDIT: This is my procfile's content - worker :python bot.py Requirements.txt:
回答1:
You can check the heroku logs using the following command in the command Prompt of your PC (you need to have Heroku CLI installed)
heroku logs -a yourappnamehere
any errors in the running of the bot will be displayed there, if there are no errors displayed in the logs, you can check the following:
1.you have put in the bot's token correctly,
2.you have put in the bot.run(token)
line at the end of your code
3.any mistakes in the Procfile or requirements files (make sure you spell requirements corretly)
- or just re-deploy your bot, and see if the problem still persists
回答2:
You could try regenerating your bot token and then redeploy it again. Or maybe you should do git commit -am "fix procfile"
回答3:
Try changing worker :python bot.py
to worker: python bot.py
and make sure your Procfile is spelled and capitalized exactly like Procfile
(capital P)
Can you open your log and tell us what the error is?
来源:https://stackoverflow.com/questions/63245834/heroku-discord-bot-builds-but-doesnt-work-when-deployed