Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New flags ACTIVE_DEVELOPER and ACTIVE #1776

Merged
merged 10 commits into from
Nov 10, 2022
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#1702](https://github.com/Pycord-Development/pycord/pull/1702))
- Added support for age-restricted (NSFW) commands.
([#1775](https://github.com/Pycord-Development/pycord/pull/1775))
- New flags: `PublicUserFlags.active_developer` & `ApplicationFlags.active_application`.
([#1776](https://github.com/Pycord-Development/pycord/pull/1776))

### Fixed

Expand Down
1 change: 1 addition & 0 deletions discord/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ class UserFlags(Enum):
discord_certified_moderator = 262144
bot_http_interactions = 524288
spammer = 1048576
active_developer = 4194304


class ActivityType(Enum):
Expand Down
17 changes: 17 additions & 0 deletions discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,14 @@ def bot_http_interactions(self):
"""
return UserFlags.bot_http_interactions.value

@flag_value
def active_developer(self):
""":class:`bool`: Returns ``True`` if the user is an Active Developer.

.. versionadded:: 2.3
"""
return UserFlags.active_developer.value

def all(self) -> list[UserFlags]:
"""List[:class:`UserFlags`]: Returns all public flags the user has."""
return [
Expand Down Expand Up @@ -1374,6 +1382,15 @@ def app_commands_badge(self):
"""
return 1 << 23

@flag_value
def active_application(self):
""":class:`bool`: Returns ``True`` if the app is considered active.
Applications are considered active if they have had any command executions in the past 30 days.

.. versionadded:: 2.3
"""
return 1 << 24


@fill_with_flags()
class ChannelFlags(BaseFlags):
Expand Down