From 15360b175127f38769b090d332643ed7bf4524a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Celderlabs=E2=80=9D?= Date: Sat, 28 Dec 2019 22:50:08 -0500 Subject: [PATCH] Changes as requested in PR by FasterSpeeding (https://github.com/FasterSpeeding) --- disco/types/guild.py | 4 ++-- disco/types/user.py | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/disco/types/guild.py b/disco/types/guild.py index e34d171..579fadc 100644 --- a/disco/types/guild.py +++ b/disco/types/guild.py @@ -389,7 +389,7 @@ class Guild(SlottedModel, Permissible): verification_level = Field(enum(VerificationLevel)) explicit_content_filter = Field(enum(ExplicitContentFilterLevel)) default_message_notifications = Field(enum(DefaultMessageNotificationsLevel)) - mfa_level = Field(int) + mfa_level = Field(enum(MFALevel)) application_id = Field(snowflake) widget_enabled = Field(bool) widget_channel_id = Field(snowflake) @@ -403,7 +403,7 @@ class Guild(SlottedModel, Permissible): channels = AutoDictField(Channel, 'id') roles = AutoDictField(Role, 'id') emojis = AutoDictField(GuildEmoji, 'id') - premium_tier = Field(int, default=0) + premium_tier = Field(enum(PremiumTier)) premium_subscription_count = Field(int, default=0) system_channel_flags = Field(int) preferred_locale = Field(str) diff --git a/disco/types/user.py b/disco/types/user.py index e67c6fc..ef65239 100644 --- a/disco/types/user.py +++ b/disco/types/user.py @@ -45,7 +45,7 @@ class User(SlottedModel, with_equality('id'), with_hash('id')): verified = Field(bool) email = Field(text) flags = Field(int) - premium_type = Field(int) + premium_type = Field(enum(PremiumType)) presence = Field(None) @@ -103,10 +103,10 @@ class Status(object): OFFLINE = 'OFFLINE' -class ClientStatus(object): - DESKTOP = 'DESKTOP' - MOBILE = 'MOBILE' - WEB = 'WEB' +class ClientStatus(SlottedModel): + desktop = Field(str) + mobile = Field(str) + web = Field(str) class ActivityParty(SlottedModel): @@ -170,5 +170,4 @@ class Presence(SlottedModel): game = Field(Activity) guild_id = Field(snowflake) status = Field(enum(Status)) - activity = Field(Activity, 'application_id') - client_status = Field(enum(ClientStatus)) + client_status = Field(ClientStatus)