Skip to content

Commit

Permalink
✨ docs: update usage section in README.md with emoji handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed Oct 13, 2024
1 parent bd1bbe5 commit fe5cf2e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ pip3 install telegram-sticker-utils
## 📖 Usage

```python
import emoji

from telegram_sticker_utils import ImageProcessor
from telegram_sticker_utils import is_animated_gif
from telegram_sticker_utils.core.const import add_emoji_rule

add_emoji_rule("sad", "😢")
try:
add_emoji_rule("sad", "😢")
add_emoji_rule("happy", emoji.emojize(":smile:"))
except ValueError as e:
print("NOT emoji")

print(is_animated_gif('test.gif')) # Path to the image file or a file-like object.

for sticker_file in ["happy.webp", "sad.png", "高兴.jpg", "悲伤.gif"]:
Expand Down

0 comments on commit fe5cf2e

Please sign in to comment.