简体   繁体   中英

Deployed Discord bot (discord.py) to Heroku, turned on the Dyno and bot not responding to commands

I've deployed my Discord bot (Discord.py) to Heroku successfully with the build working, I switched on the Dyno and it said the bot has come online and shows as online on Discord's member list on the server. But when I type commands (such as '?help'), the bot doesn't respond at all. Any help would be appreciated, please speak in understandable terms as I'm not the best with too technical language. The token etc. works (and the bot deploys from a private GitHub repo which I know works). I've tried turning on the Dyno then deploying, still no response from the bot.

Any help will be appreciated.

EDIT: I've just checked Heroku's logs and it says:

2018-04-10T18:04:27.605666+00:00 app[worker.1]: The above exception was the direct cause of the following exception:
2018-04-10T18:04:27.605667+00:00 app[worker.1]: 
2018-04-10T18:04:27.605669+00:00 app[worker.1]: Traceback (most recent call last):
2018-04-10T18:04:27.605697+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 822, in process_commands
2018-04-10T18:04:27.605698+00:00 app[worker.1]:     yield from command.invoke(ctx)
2018-04-10T18:04:27.605700+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 367, in invoke
2018-04-10T18:04:27.605701+00:00 app[worker.1]:     yield from injected(*ctx.args, **ctx.kwargs)
2018-04-10T18:04:27.605705+00:00 app[worker.1]:     raise CommandInvokeError(e) from e
2018-04-10T18:04:27.605704+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 52, in wrapped
2018-04-10T18:04:27.605729+00:00 app[worker.1]: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: module 'discord' has no attribute 'Embed'`

Basically that it has no attribute Embed. Can someone help me fix this please? My requirements.txt is the following:

discord.py
websockets
chardet

Do I need to add something to my runtime etc.?

This isnt really python related, but are you tagged as an owner of the bot? does the bot have permissions to type in the channel you are requesting it to type in? This is typically something you would ask the owner of the bot/help channel.

SOLVED: After another HOUR of trying many things, I removed my .gitignore and renamed my main.py to run.py. I changed the discord.py version in requirements.txt to what Heroku upgraded it to and re-deployed the bot, and I think upgrading it fixed it, so, job done. I updated the Procfile with the name change from main.py to run.py. Thanks for the help Justin!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM