Check
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -4,5 +4,10 @@ bin/
|
||||
include/
|
||||
lib/
|
||||
lib64/
|
||||
__pycache__/
|
||||
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.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 sqlalchemy import desc
|
||||
from service import UserService
|
||||
@@ -131,6 +131,8 @@ async def button_handler(update: Update, context):
|
||||
def main() -> None:
|
||||
init_db()
|
||||
application = Application.builder().token(config['token']).build()
|
||||
|
||||
application.add_handler(CommandHandler("start", start))
|
||||
|
||||
application.add_handler(CallbackQueryHandler(button_handler))
|
||||
application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, sup))
|
||||
|
||||
Reference in New Issue
Block a user