diff options
| author | Rapptz <[email protected]> | 2016-09-12 22:38:06 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-09-12 22:38:06 -0400 |
| commit | 203c64a9a43b7e4da7b8f118abcf30eaea7b7b96 (patch) | |
| tree | d7ba393ce45cec95cf79133a86ef853501fc2b15 /discord/client.py | |
| parent | Document new MessageType.pins_add (diff) | |
| download | discord.py-203c64a9a43b7e4da7b8f118abcf30eaea7b7b96.tar.xz discord.py-203c64a9a43b7e4da7b8f118abcf30eaea7b7b96.zip | |
Add support for server verification levels.
This adds a new enum named VerificationLevel to denote said verification
level. This enum will also be used in the Client.edit_server calls
instead of the undocumented int parameter.
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py index 93679244..74a417cd 100644 --- a/discord/client.py +++ b/discord/client.py @@ -38,7 +38,7 @@ from .errors import * from .state import ConnectionState from .permissions import Permissions, PermissionOverwrite from . import utils, compat -from .enums import ChannelType, ServerRegion +from .enums import ChannelType, ServerRegion, VerificationLevel from .voice_client import VoiceClient from .iterators import LogsFromIterator from .gateway import * @@ -1930,6 +1930,8 @@ class Client: owner : :class:`Member` The new owner of the server to transfer ownership to. Note that you must be owner of the server to do this. + verification_level: :class:`VerificationLevel` + The new verification level for the server. Raises ------- @@ -1968,6 +1970,11 @@ class Client: if 'region' in fields: fields['region'] = str(fields['region']) + level = fields.get('verification_level', server.verification_level) + if not isinstance(level, VerificationLevel): + raise InvalidArgument('verification_level field must of type VerificationLevel') + + fields['verification_level'] = level.value yield from self.http.edit_server(server.id, **fields) @asyncio.coroutine |