Skip to content

Commit

Permalink
Merge pull request #128 from nekokatt/task/rename-user-flags
Browse files Browse the repository at this point in the history
Renamed some user flags.
  • Loading branch information
Nekokatt authored Sep 7, 2020
2 parents 7d40abc + 23477bf commit 4846fef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions hikari/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,43 @@ class UserFlag(flag.Flag):
"""None"""

DISCORD_EMPLOYEE = 1 << 0
"""Discord Employee"""
"""Discord Employee."""

DISCORD_PARTNER = 1 << 1
"""Discord Partner"""
PARTNERED_SERVER_OWNER = 1 << 1
"""Owner of a partnered Discord server."""

HYPESQUAD_EVENTS = 1 << 2
"""HypeSquad Events"""
"""HypeSquad Events."""

BUG_HUNTER_LEVEL_1 = 1 << 3
"""Bug Hunter Level 1"""
"""Bug Hunter Level 1."""

HOUSE_BRAVERY = 1 << 6
"""House of Bravery"""
HYPESQUAD_BRAVERY = 1 << 6
"""House of Bravery."""

HOUSE_BRILLIANCE = 1 << 7
"""House of Brilliance"""
HYPESQUAD_BRILLIANCE = 1 << 7
"""House of Brilliance."""

HOUSE_BALANCE = 1 << 8
"""House of Balance"""
HYPESQUAD_BALANCE = 1 << 8
"""House of Balance."""

EARLY_SUPPORTER = 1 << 9
"""Early Supporter"""
"""Early Supporter."""

TEAM_USER = 1 << 10
"""Team user"""
"""Team user."""

SYSTEM = 1 << 12
"""System"""
"""System user."""

BUG_HUNTER_LEVEL_2 = 1 << 14
"""Bug Hunter Level 2"""
"""Bug Hunter Level 2."""

VERIFIED_BOT = 1 << 16
"""Verified Bot"""
"""Verified Bot."""

EARLY_VERIFIED_DEVELOPER = 1 << 17
"""Verified Bot Developer.
"""Early verified Bot Developer.
Only applies to users that verified their account before 20th August 2019.
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/hikari/impl/test_entity_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2900,7 +2900,7 @@ def my_user_payload(self):
"locale": "en-US",
"mfa_enabled": True,
"public_flags": int(user_models.UserFlag.EARLY_VERIFIED_DEVELOPER),
"flags": int(user_models.UserFlag.DISCORD_PARTNER | user_models.UserFlag.DISCORD_EMPLOYEE),
"flags": int(user_models.UserFlag.PARTNERED_SERVER_OWNER | user_models.UserFlag.DISCORD_EMPLOYEE),
"premium_type": 1,
}

Expand All @@ -2917,7 +2917,7 @@ def test_deserialize_my_user(self, entity_factory_impl, mock_app, my_user_payloa
assert my_user.locale == "en-US"
assert my_user.is_verified is True
assert my_user.email == "[email protected]"
assert my_user.flags == user_models.UserFlag.DISCORD_PARTNER | user_models.UserFlag.DISCORD_EMPLOYEE
assert my_user.flags == user_models.UserFlag.PARTNERED_SERVER_OWNER | user_models.UserFlag.DISCORD_EMPLOYEE
assert my_user.premium_type is user_models.PremiumType.NITRO_CLASSIC
assert isinstance(my_user, user_models.OwnUser)

Expand All @@ -2931,7 +2931,7 @@ def test_deserialize_my_user_with_unset_fields(self, entity_factory_impl, mock_a
"locale": "en-US",
"mfa_enabled": True,
"public_flags": int(user_models.UserFlag.EARLY_VERIFIED_DEVELOPER),
"flags": int(user_models.UserFlag.DISCORD_PARTNER | user_models.UserFlag.DISCORD_EMPLOYEE),
"flags": int(user_models.UserFlag.PARTNERED_SERVER_OWNER | user_models.UserFlag.DISCORD_EMPLOYEE),
"premium_type": 1,
}
)
Expand Down

0 comments on commit 4846fef

Please sign in to comment.