init commit
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
2025-09-04 01:51:59 +09:00
commit aca280b64d
1841 changed files with 753304 additions and 0 deletions

17
handlers/add_channel.py Normal file
View File

@@ -0,0 +1,17 @@
from telegram import Update
from telegram.ext import ContextTypes
from db import SessionLocal
from models import Channel
async def add_channel(update: Update, context: ContextTypes.DEFAULT_TYPE):
args = context.args
if len(args) < 2:
await update.message.reply_text('Используйте: /add_channel <название> <ссылка>')
return
name, link = args[0], args[1]
session = SessionLocal()
channel = Channel(name=name, link=link)
session.add(channel)
session.commit()
session.close()
await update.message.reply_text(f'Канал "{name}" добавлен.')