Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
telegram_bot_antispammer
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иванова Мария Кирилловна
telegram_bot_antispammer
Commits
a46cb548
Commit
a46cb548
authored
Feb 12, 2025
by
Иванова Мария Кирилловна
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update bot.py
parent
5e33dbe3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
bot.py
bot.py
+3
-6
No files found.
bot.py
View file @
a46cb548
...
...
@@ -84,9 +84,6 @@ def preprocess_spam_keywords(keywords):
"""Приводит ключевые слова к нормализованной форме."""
return
set
(
' '
.
join
(
normalize_text_to_infinitive
(
keyword
))
for
keyword
in
keywords
)
# Нормализуем ключевые слова
SPAM_KEYWORDS
=
preprocess_spam_keywords
(
SPAM_KEYWORDS
)
# Загрузка переменных из файла .env
load_dotenv
()
...
...
@@ -103,6 +100,8 @@ dp.include_router(router)
# Для хранения информации о новых участниках
active_users
=
{}
morph
=
MorphAnalyzer
()
def
has_mixed_layout
(
text
):
"""
Проверяет, содержит ли текст слова, написанные на смешанной раскладке.
...
...
@@ -119,9 +118,6 @@ def has_mixed_layout(text):
return
True
# Найдено слово со смешанной раскладкой
return
False
morph
=
MorphAnalyzer
()
# Регулярное выражение для распознавания эмодзи
emoji_pattern
=
re
.
compile
(
"["
u"
\U0001F600
-
\U0001F64F
"
# emoticons
...
...
@@ -375,4 +371,5 @@ async def main():
await
dp
.
start_polling
(
bot
)
if
__name__
==
"__main__"
:
SPAM_KEYWORDS
=
preprocess_spam_keywords
(
SPAM_KEYWORDS
)
asyncio
.
run
(
main
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment