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
7bfe4260
Commit
7bfe4260
authored
Mar 31, 2026
by
Ivan Mazhukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proxy
parent
d703acaa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
bot.py
bot.py
+8
-1
requirements.txt
requirements.txt
+1
-0
No files found.
bot.py
View file @
7bfe4260
...
...
@@ -11,6 +11,7 @@ from aiogram.filters import CommandObject
import
logging
from
aiogram
import
types
from
aiogram.types
import
ChatMemberUpdated
,
Message
,
BotCommand
from
aiogram.client.session.aiohttp
import
AiohttpSession
from
spam_keywords
import
is_spam
,
SPAM_KEYWORDS
from
symbol_utils
import
has_mixed_layout
,
is_arabic_name
,
normalize_text_to_infinitive
...
...
@@ -26,12 +27,18 @@ bot_token = os.getenv("BOT_TOKEN")
log_chat_id
=
os
.
getenv
(
"LOG_CHAT_ID"
)
main_chat_id
=
os
.
getenv
(
"MAIN_CHAT_ID"
)
db_path
=
os
.
getenv
(
"DB_PATH"
)
proxy_url
=
os
.
getenv
(
"PROXY_URL"
)
# Вызов функции для создания базы данных или подключения к существующей
create_db
()
# Инициализация бота и диспетчера
bot
=
Bot
(
token
=
bot_token
)
if
proxy_url
:
session
=
AiohttpSession
(
proxy
=
proxy_url
)
bot
=
Bot
(
token
=
bot_token
,
session
=
session
)
else
:
bot
=
Bot
(
token
=
bot_token
)
dp
=
Dispatcher
()
router
=
Router
()
...
...
requirements.txt
View file @
7bfe4260
...
...
@@ -2,3 +2,4 @@ aiogram
pymorphy3
emoji
python-dotenv
aiohttp-socks
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