#creating listeners outside of the main file?
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
creating listeners outside of the main file?
so in my main class it would be the following listener:
@listen()
async def on_ready():
global bot_info
print(f'Logged in as {bot.user.username} ({bot.user.id})')
ns.logthis("info", f"Logged in as {bot.user.username} ({bot.user.id})")
await bot.change_presence(activity=Activity(name=bot_info["general_variables"]["startup_activity"], type=ActivityType.WATCHING))```
In my Extesnion it would be something like this:
```class listeners(Extension):
@listen()
async def on_message_delete(self):
do some crazy stuff here
def setup(bot):
listeners(bot)```
but it says the listen decorator has no referrence
well you gotta import listen
Awh man... sorry for bothering you 