Add support for voice channel parties #33

Closed
wasi-master wants to merge 277 commits from master into 2.0
128 changed files with 12273 additions and 18795 deletions
Showing only changes of commit 9fc2fd38dc - Show all commits

View File

@ -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."""