This commit is contained in:
harold 2025-05-28 16:51:21 +05:00
parent 4f33788362
commit a7fa075167
3 changed files with 24 additions and 2 deletions

View File

@ -310,6 +310,21 @@ files = [
{file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"},
]
[[package]]
name = "emoji"
version = "2.14.1"
description = "Emoji for Python"
optional = false
python-versions = ">=3.7"
groups = ["main"]
files = [
{file = "emoji-2.14.1-py3-none-any.whl", hash = "sha256:35a8a486c1460addb1499e3bf7929d3889b2e2841a57401903699fef595e942b"},
{file = "emoji-2.14.1.tar.gz", hash = "sha256:f8c50043d79a2c1410ebfae833ae1868d5941a67a6cd4d18377e2eb0bd79346b"},
]
[package.extras]
dev = ["coverage", "pytest (>=7.4.4)"]
[[package]]
name = "exceptiongroup"
version = "1.2.2"
@ -1920,4 +1935,4 @@ propcache = ">=0.2.0"
[metadata]
lock-version = "2.1"
python-versions = ">=3.11, <4.0"
content-hash = "cebf22706bd49da4de34ae307eccd698cd1195f96ae0dd92d7c1311abb3fe979"
content-hash = "8d9d9fd14dae4dfc99b18096b87a59e6bca68ecf03bdc411f4b2c428e556c9a6"

View File

@ -22,7 +22,8 @@ dependencies = [
"pyrogram (>=2.0.106,<3.0.0)",
"sqladmin (>=0.20.1,<0.21.0)",
"fastapi (>=0.115.12,<0.116.0)",
"uvicorn (>=0.34.2,<0.35.0)"
"uvicorn (>=0.34.2,<0.35.0)",
"emoji (>=2.14.1,<3.0.0)"
]

View File

@ -1,3 +1,5 @@
import emoji
from pyrogram.types import Message
from pyrogram.enums import ChatType
@ -20,6 +22,10 @@ def check_message_condition(
if 'bot' in message.from_user.username.lower():
return False
emoji_count = emoji.emoji_count(message.text)
if emoji_count > 3:
return False
return True