mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-25 02:23:04 +00:00 
			
		
		
		
	Add Server.mfa_level to query a server's 2FA requirement.
This commit is contained in:
		| @@ -86,12 +86,16 @@ class Server(Hashable): | |||||||
|         Indicates if the server is a 'large' server. A large server is defined as having |         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 |         more than ``large_threshold`` count members, which for this library is set to | ||||||
|         the maximum of 250. |         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', |     __slots__ = ['afk_timeout', 'afk_channel', '_members', '_channels', 'icon', | ||||||
|                  'name', 'id', 'owner', 'unavailable', 'name', 'region', |                  'name', 'id', 'owner', 'unavailable', 'name', 'region', | ||||||
|                  '_default_role', '_default_channel', 'roles', '_member_count', |                  '_default_role', '_default_channel', 'roles', '_member_count', | ||||||
|                  'large', 'owner_id' ] |                  'large', 'owner_id', 'mfa_level' ] | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self._channels = {} |         self._channels = {} | ||||||
| @@ -180,6 +184,7 @@ class Server(Hashable): | |||||||
|         self.unavailable = guild.get('unavailable', False) |         self.unavailable = guild.get('unavailable', False) | ||||||
|         self.id = guild['id'] |         self.id = guild['id'] | ||||||
|         self.roles = [Role(server=self, **r) for r in guild.get('roles', [])] |         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', []): |         for mdata in guild.get('members', []): | ||||||
|             roles = [self.default_role] |             roles = [self.default_role] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user