Fix invalid emoji validation in Component class
This commit is contained in:
parent
260a85de2f
commit
c99e67110a
1 changed files with 2 additions and 2 deletions
|
|
@ -99,8 +99,8 @@ class Component:
|
|||
# we are going to use the emoji library to validate the emoji
|
||||
# emojis can be defined using the :emoji_name: syntax
|
||||
if not value.startswith(":") or not value.endswith(":"):
|
||||
raise ValueError("Invalid emoji. Please use the :emoji_name: syntax.")
|
||||
|
||||
warnings.warn("Invalid emoji. Please use the :emoji_name: syntax.")
|
||||
return value
|
||||
emoji_value = emoji.emojize(value, variant="emoji_type")
|
||||
if value == emoji_value:
|
||||
warnings.warn(f"Invalid emoji. {value} is not a valid emoji.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue