Check
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -4,5 +4,10 @@ bin/
|
|||||||
include/
|
include/
|
||||||
lib/
|
lib/
|
||||||
lib64/
|
lib64/
|
||||||
|
__pycache__/
|
||||||
lib64
|
lib64
|
||||||
|
*.log.*
|
||||||
*.log
|
*.log
|
||||||
|
__pycache__/
|
||||||
|
__pycache__/db.cpython-312.pyc
|
||||||
|
__pycache__/logger_config.cpython-312.pyc
|
||||||
|
|||||||
4
bot.py
4
bot.py
@@ -1,5 +1,5 @@
|
|||||||
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
|
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
|
||||||
from telegram.ext import Application, CallbackQueryHandler, ContextTypes, MessageHandler, filters
|
from telegram.ext import Application, CallbackQueryHandler, ContextTypes, MessageHandler, filters,CommandHandler
|
||||||
from db import User, VPNServer, Transaction, Subscription, get_db_session, init_db, SessionLocal
|
from db import User, VPNServer, Transaction, Subscription, get_db_session, init_db, SessionLocal
|
||||||
from sqlalchemy import desc
|
from sqlalchemy import desc
|
||||||
from service import UserService
|
from service import UserService
|
||||||
@@ -132,6 +132,8 @@ def main() -> None:
|
|||||||
init_db()
|
init_db()
|
||||||
application = Application.builder().token(config['token']).build()
|
application = Application.builder().token(config['token']).build()
|
||||||
|
|
||||||
|
application.add_handler(CommandHandler("start", start))
|
||||||
|
|
||||||
application.add_handler(CallbackQueryHandler(button_handler))
|
application.add_handler(CallbackQueryHandler(button_handler))
|
||||||
application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, sup))
|
application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, sup))
|
||||||
application.run_polling(allowed_updates=Update.ALL_TYPES)
|
application.run_polling(allowed_updates=Update.ALL_TYPES)
|
||||||
|
|||||||
Reference in New Issue
Block a user