diff --git a/discord/flags.py b/discord/flags.py index 0c81b103..6919f92a 100644 --- a/discord/flags.py +++ b/discord/flags.py @@ -402,6 +402,19 @@ class Intents(BaseFlags): raise TypeError('%r is not a valid flag name.' % key) setattr(self, key, value) + @classmethod + def from_list(cls, intents_list): + for item in intents_list: + if item not in cls.VALID_FLAGS.keys(): + intents_list.remove(item) + + self = cls.__new__(cls) + for item in cls.VALID_FLAGS.keys(): + if item not in intents_list: + setattr(self, item, False) + + return self + @classmethod def all(cls): """A factory method that creates a :class:`Intents` with everything enabled."""