X
X
x4zx2021-07-11 23:01:00
Python
x4zx, 2021-07-11 23:01:00

How to host a discord bot if I use cogs?

Hello, I created a bot for discord, but I use cogs - that is, there is one file in which the token is located and a code that also launches files from a certain folder with the ending (".py")

for filename in os.listdir("./cogs" ):
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")

I know how to host the bot if all the code is in one file, but I don't know how if multiple files are
used I use Heroku hosting

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Mokhovikov, 2021-07-12
@x4zx

Execute these commands:

git add .
git commit -am "make it better"
git push heroku master

This list of commands will upload all project files to the server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question