Port event listeners from commands.Bot -> nextcord.Client #892
Labels
p: low
Priority: low - not important to be worked on
s: awaiting review
Status: the issue or PR is awaiting reviews
t: refactor
Type: refactor - this is a code change but does not fix a bug/add features
Summary
Port event listeners from commands.Bot to nextcord.Client.
What is the feature request for?
The core library
The Problem
Currently with
nextcord.Client
, you can only have one callback per event. You can override event callbacks with your own behavior, but you can't have multiple listeners that don't affect the default event callback.The Ideal Solution
Port event listeners from
commands.Bot
but keep the event override functionality since that will break many bots that rely on this. This can be performed with a simple dictionary that maps event names -> lists of coroutines that are event listeners. Then, when a certain event is dispatched, we loop through all of the event listeners mapped to that event and run them all.The Current Solution
This functionality has already been implemented in
ext.commands
, so you can use that.Additional Context
No response
The text was updated successfully, but these errors were encountered: