M
M
Maxim-122019-08-13 12:13:21
Python
Maxim-12, 2019-08-13 12:13:21

Discord bot not working on Heroku (?

If you run the bot on a PC, it works, but on Heroku it refuses in every possible way.
The github repository has the following files:

  • Procfile
  • README.md
  • disbot.py
  • requirements.txt
  • runtime.txt

Procfile
worker: python disbot.py
disbot.py
import discord
from discord.ext import commands
from discord.ext.commands import Bot

Bot = commands.Bot(command_prefix='!')

@Bot.event
async def on_ready():
    print('Бот онлайн!')

@Bot.command(pass_context = True)
async def hello(ctx):
    await Bot.say("Hello!!!")

Bot.run("")  // токен убрал на всякий случай

requirements.txt
discord.py
aiohttp
websockets
chardet

runtime.txt
python-3.6.8

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergeo1, 2019-08-23
@sergeo1

When you wrote discord.py in requirements.txt, you have the latest version of discord.py installed. Bot.say ("something") refers to the old version ( async ) in the new one ( rewrite ) you need to write ctx.send("something")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question