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

Gateway Intents configuration #10

Open
lun-4 opened this issue Oct 8, 2020 · 1 comment
Open

Gateway Intents configuration #10

lun-4 opened this issue Oct 8, 2020 · 1 comment

Comments

@lun-4
Copy link
Collaborator

lun-4 commented Oct 8, 2020

As we have hit the deadline for intents (Oct 7th), bots now operate under the default set of intents, which is all intents minus the privileged ones (members and presence).

For now, bots just declare their intents while instantiating the bot, but we could do something better.

My proposal is to add an intents key on the yaml configuration file, it would point to a list of strings representing the fields in the discord.Intents object. It would work like this:

  • Start off from the default set of intents, discord.Intents.default()
  • Add or remove intents if they are in the list or the string starts with ! respectively
  • Feed that to Bot(..., intents=intents)

Example, adding the members intent but removing the typing intent:

intents: [members, !typing]
@slice
Copy link
Owner

slice commented Dec 31, 2020

Initial support was added in 00c3811.

It accepts either a string or a list of strings—the former being a name of a discord.Intents classmethod, the latter a list of kwargs to pass to __init__.

! support is nice and I'll implement it in the future, probably by unifying the classmethod way and list way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants