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

custom_status() helper function #5884

Closed
ChrisGallardo opened this issue Oct 4, 2020 · 1 comment
Closed

custom_status() helper function #5884

ChrisGallardo opened this issue Oct 4, 2020 · 1 comment
Labels
feature request This is a feature request. wontfix This will not be worked on.

Comments

@ChrisGallardo
Copy link

The Problem

Like I said in my question (#5883), getting a member's custom status seems way too difficult for something that seems to be needed often. Here is the easiest way I've found to get a user's custom status:

for act in member.activities:
    if isinstance(act, discord.CustomActivity):
        return str(act)

This took me a little while to find, and I don't want to make it this hard for others.

The Ideal Solution

The ideal solution would be to add this helper function to the Member class, like this:

class Member(discord.abc.Messageable, _BaseUser):
    ...
    def custom_status(self):
        """returns a member's custom status"""
        for act in member.activities:
            if isinstance(act, discord.CustomActivity):
                return act
    ...

The Current Solution

Right now, the only solution I've found is to write this function yourself.

Summary

Add a helper function, custom_status() that returns a member's custom status.
If possible, I'd like to be assigned to this.

@ChrisGallardo ChrisGallardo added the feature request This is a feature request. label Oct 4, 2020
@ChrisGallardo ChrisGallardo changed the title member.custom_status() helper function custom_status() helper function Oct 4, 2020
@Rapptz
Copy link
Owner

Rapptz commented Oct 4, 2020

This is a bit too niche.

There are many types of statuses out there that someone else might be interested in to the point where your helper special cases one because you, personally, consider it important. This might not be the case for someone else. Nevertheless, there's nothing wrong with making a helper function and using it, that's just how programming tends to be. Not every helper function has a place in the main library.

@Rapptz Rapptz closed this as completed Oct 4, 2020
@Rapptz Rapptz added the wontfix This will not be worked on. label Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request This is a feature request. wontfix This will not be worked on.
Projects
None yet
Development

No branches or pull requests

2 participants