Heroku Discord Bot builds but doesn't work when deployed

☆樱花仙子☆ 提交于 2021-01-28 08:23:57

问题


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)

  1. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!