slice / lifesaver

batteries-included discord bot framework for discord.py
https://lifesaver.rtfd.io
Other
8 stars 2 forks source link

Gateway Intents configuration #10

Open lun-4 opened 3 years ago

lun-4 commented 3 years ago

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:

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

intents: [members, !typing]
slice commented 3 years ago

Initial support was added in https://github.com/slice/lifesaver/commit/00c38112a512efd964cbbf0533096eff0a29f79f.

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.