Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port event listeners from commands.Bot -> nextcord.Client #892

Open
EmreTech opened this issue Nov 7, 2022 · 0 comments · May be fixed by #917
Open

Port event listeners from commands.Bot -> nextcord.Client #892

EmreTech opened this issue Nov 7, 2022 · 0 comments · May be fixed by #917
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

Comments

@EmreTech
Copy link
Collaborator

EmreTech commented Nov 7, 2022

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

@EmreTech EmreTech added t: enhancement Type: enhancement - new feature or request p: low Priority: low - not important to be worked on labels Nov 7, 2022
@EmreTech EmreTech linked a pull request Nov 23, 2022 that will close this issue
7 tasks
@EmreTech EmreTech added 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 and removed t: enhancement Type: enhancement - new feature or request labels Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
No open projects
Status: In Cycle
Development

Successfully merging a pull request may close this issue.

1 participant