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: add support for custom status #2206

Merged
merged 8 commits into from Aug 18, 2023

Conversation

Dorukyum
Copy link
Member

@Dorukyum Dorukyum commented Aug 9, 2023

Summary

Closes #2204.
Defaults Activity.name to "Custom Status" if the type is ActivityType.custom when initializing, but not sure if this is the best way to do it. This currently requires developers to explicitly set the type field to ActivityType.custom because it defaults to ActivityType.unknown, as seen in the example below:

await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.custom, state="I'm Batman."))

I feel like this should be made easier on the developer frontend, resulting with the following:

await bot.change_presence(activity=discord.Activity(state="I'm Batman."))
# or maybe even this:
await bot.change_presence(activity=discord.Activity("I'm Batman."))

I'm ready to push the change necessary to implement the last suggestion if the idea is approved.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@Dorukyum Dorukyum added priority: medium Medium Priority status: in progress Work in Progess feature Implements a feature API Reflection Discords API wasn't correctly reflected in the lib changelog needed labels Aug 9, 2023
@Dorukyum Dorukyum added this to the v2.5 milestone Aug 9, 2023
@Dorukyum Dorukyum self-assigned this Aug 9, 2023
@Dorukyum Dorukyum added status: awaiting review Awaiting review from a maintainer and removed status: in progress Work in Progess changelog needed labels Aug 10, 2023
Lulalaby
Lulalaby previously approved these changes Aug 14, 2023
@Dorukyum Dorukyum marked this pull request as ready for review August 17, 2023 09:59
@Dorukyum Dorukyum requested a review from a team as a code owner August 17, 2023 09:59
@Dorukyum
Copy link
Member Author

CustomActivity.state will now be set to .name by default, which means developers can now write the following code to create a custom bot status:

activity = discord.CustomActivity("I'm Batman.")

This will have the same effect as:

activity = discord.Activity(type=discord.ActivityType.custom, state="I'm Batman.")

@OmLanke
Copy link
Contributor

OmLanke commented Aug 17, 2023

LGTM

@Lulalaby Lulalaby enabled auto-merge (squash) August 17, 2023 19:41
@Lulalaby Lulalaby merged commit a261176 into Pycord-Development:master Aug 18, 2023
26 checks passed
@Dorukyum Dorukyum deleted the custom-status branch August 18, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Reflection Discords API wasn't correctly reflected in the lib feature Implements a feature priority: medium Medium Priority status: awaiting review Awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for custom status
3 participants