Ask coding questions

← Back to all posts
HOW TO USE COGS | Discord.py
DwellerIgor (1)

Hello! Please take a look at my currency.py file. When I activate my bot only main.py works. I'm using cogs to save the space a little bit, so i don't need to make another project. But the this is the bot can't find any command from currency.py, so I thought I've done something wrong with COGS. Please help me! Very appreciated!

Answered by Coder100 (18917) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18917)

please, read the error.
As the say, you need to add await to all async functions.
So that means you need to add await to line 89 and 88 in currency.py.

DwellerIgor (1)

sorry, im dumb. it is great that you help me a lot, [email protected]

DwellerIgor (1)

i get this: /home/runner/THANOS-COMMANDS/currency.py:88: RuntimeWarning: coroutine 'Command.call' was never awaited
self.add_user(message.author)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/home/runner/THANOS-COMMANDS/currency.py:89: RuntimeWarning: coroutine 'Command.call' was never awaited
self.add_credits(message.author)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Ignoring exception in on_message
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/home/runner/THANOS-COMMANDS/currency.py", line 94, in on_message
main_balance = main_balance[0]
TypeError: 'NoneType' object is not subscriptable
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "balance" is not found