Skip to content

feat(emoji)!: implement app emojis #1224

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

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

Snipy7374
Copy link
Collaborator

@Snipy7374 Snipy7374 commented Aug 10, 2024

Summary

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running pdm lint
    • I have type-checked the code by running pdm pyright
  • 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, ...)

@shiftinv shiftinv added t: enhancement New feature t: api support Support of Discord API features s: in progress Issue/PR is being worked on labels Aug 11, 2024
@Snipy7374 Snipy7374 marked this pull request as ready for review August 21, 2024 09:56
@Snipy7374
Copy link
Collaborator Author

I marked this ready for review even though i still don't know if we should provide the ability to cache app emojis at startup, as you can see i did put a boolean argument but didn't implement any logic for it so far.

Copy link
Member

@Victorsitou Victorsitou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the documentation, referring the emojis as "application emojis" instead of "app emojis" would be more consistent

@shiftinv shiftinv self-requested a review November 14, 2024 14:33
Snipy7374 and others added 8 commits November 26, 2024 17:47
Co-authored-by: Victor <[email protected]>
Signed-off-by: Snipy7374 <[email protected]>
Co-authored-by: Victor <[email protected]>
Signed-off-by: Snipy7374 <[email protected]>
Co-authored-by: Victor <[email protected]>
Signed-off-by: Snipy7374 <[email protected]>
Co-authored-by: Victor <[email protected]>
Signed-off-by: Snipy7374 <[email protected]>
Co-authored-by: Victor <[email protected]>
Signed-off-by: Snipy7374 <[email protected]>
Co-authored-by: Victor <[email protected]>
Signed-off-by: Snipy7374 <[email protected]>
Co-authored-by: Victor <[email protected]>
Signed-off-by: Snipy7374 <[email protected]>
Copy link
Contributor

@Enegg Enegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since .guild/.guild_id is changed to possibly return None, this is a breaking change. (Rename PR title to feat!(emoji): ...?)

Personally I'd rather see a separate class for app emojis.

@Snipy7374 Snipy7374 changed the title feat(emoji): implement app emojis feat!(emoji): implement app emojis Apr 14, 2025
@Snipy7374 Snipy7374 changed the title feat!(emoji): implement app emojis feat(emoji)!: implement app emojis Apr 14, 2025
@Snipy7374 Snipy7374 requested review from Enegg and Victorsitou April 14, 2025 15:37
Copy link
Contributor

@Enegg Enegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm strongly in favor of splitting the models into a GuildEmoji and AppEmoji. The current approach is pretty much saying "an Emoji can have both .guild_id and .application_id, one of, or neither!"

Anyhow, minor nitpicks below.

@@ -0,0 +1 @@
:attr:`Emoji.guild_id` can now be ``None`` is the emoji is owned by an application. You can use :meth:`Emoji.is_app_emoji` to check for that.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:attr:`Emoji.guild_id` can now be ``None`` is the emoji is owned by an application. You can use :meth:`Emoji.is_app_emoji` to check for that.
:attr:`Emoji.guild_id` can now be ``None`` if the emoji is owned by an application. You can use :meth:`Emoji.is_app_emoji` to check for that.


This can now return ``None`` if the emoji is an
application owned emoji.
"""
# this will most likely never return None but there's a possibility
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is no longer saying anything useful, remove it perhaps?

Comment on lines +195 to +197
if self.guild_id is None:
return True
return False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self.guild_id is None:
return True
return False
return self.guild_id is None

@Snipy7374
Copy link
Collaborator Author

Snipy7374 commented Apr 14, 2025

I'm strongly in favor of splitting the models into a GuildEmoji and AppEmoji. The current approach is pretty much saying "an Emoji can have both .guild_id and .application_id, one of, or neither!"

Anyhow, minor nitpicks below.

If we want to split them into different classes (I had this talk with @shiftinv in the past, but at the time they said it was fine to go with this approach) we would most likely split them into Emoji and AppEmoji to minimize breaking changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: in progress Issue/PR is being worked on t: api support Support of Discord API features t: enhancement New feature
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

implement app emojis
4 participants