Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

feat 💥: improve emoji parsing in from_str #673

Merged
merged 3 commits into from
Oct 17, 2022
Merged

Conversation

LordOfPolls
Copy link
Member

What type of pull request is this?

  • Non-breaking code change
  • Breaking code change
  • Documentation change/addition
  • Tests change

Description

Improves PartialEmoji.from_str to handle more kinds of emoji. If no emoji can be parsed, this method now returns None (breaking)

This method can now handle the following payloads:

<:emoji_name:emoji_id>
:emoji_name:emoji_id
<a:emoji_name:emoji_id>
a:emoji_name:emoji_id
👋  # improved
:wave:  # new

Changes

  • Add emoji as a dependency
  • Update from_str to utilise emoji dep
  • from_str now returns None when no match can be found

Checklist

  • I've formatted my code with Black
  • I've ensured my code works on Python 3.10.x
  • I've tested my code

@LordOfPolls LordOfPolls added Improvement Something that is already implemented but can be done better New Feature::Library A new feature for the library labels Oct 16, 2022
@Wolfhound905
Copy link
Collaborator

Please add the emoji library to pyproject.toml

Copy link
Collaborator

@Wolfhound905 Wolfhound905 left a comment

Choose a reason for hiding this comment

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

Other than what I said above, tested, and working.

@LordOfPolls LordOfPolls merged commit 11f328b into 2.x Oct 17, 2022
@LordOfPolls LordOfPolls deleted the emoji-parsing branch October 17, 2022 18:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Improvement Something that is already implemented but can be done better New Feature::Library A new feature for the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants