mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
Add Server.mfa_level to query a server's 2FA requirement.
This commit is contained in:
parent
d87d11c5a6
commit
30d623cd46
@ -86,12 +86,16 @@ class Server(Hashable):
|
||||
Indicates if the server is a 'large' server. A large server is defined as having
|
||||
more than ``large_threshold`` count members, which for this library is set to
|
||||
the maximum of 250.
|
||||
mfa_level: int
|
||||
Indicates the server's two factor authorisation level. If this value is 0 then
|
||||
the server does not require 2FA for their administrative members. If the value is
|
||||
1 then they do.
|
||||
"""
|
||||
|
||||
__slots__ = ['afk_timeout', 'afk_channel', '_members', '_channels', 'icon',
|
||||
'name', 'id', 'owner', 'unavailable', 'name', 'region',
|
||||
'_default_role', '_default_channel', 'roles', '_member_count',
|
||||
'large', 'owner_id' ]
|
||||
'large', 'owner_id', 'mfa_level' ]
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self._channels = {}
|
||||
@ -180,6 +184,7 @@ class Server(Hashable):
|
||||
self.unavailable = guild.get('unavailable', False)
|
||||
self.id = guild['id']
|
||||
self.roles = [Role(server=self, **r) for r in guild.get('roles', [])]
|
||||
self.mfa_level = guild.get('mfa_level')
|
||||
|
||||
for mdata in guild.get('members', []):
|
||||
roles = [self.default_role]
|
||||
|
Loading…
x
Reference in New Issue
Block a user