This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Telegram/modules/commands/sponsorship.py

14 lines
1.0 KiB
Python
Raw Normal View History

2022-12-15 16:12:52 +02:00
from app import app, isAnAdmin
2022-12-10 11:42:56 +02:00
from pyrogram import filters
2022-12-21 13:25:47 +02:00
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from modules.utils import locale, should_quote
2022-12-15 16:12:52 +02:00
from modules.database import col_applications
2022-12-10 11:42:56 +02:00
# Sponsorship command ==========================================================================================================
@app.on_message(~ filters.scheduled & filters.command(["sponsorship"], prefixes=["/"]))
async def cmd_sponsorship(app, msg):
2022-12-15 16:12:52 +02:00
if (await isAnAdmin(msg) is True) or (col_applications.find_one({"user": msg.from_user.id}) is not None):
2022-12-21 13:25:47 +02:00
await msg.reply_text(locale("sponsorship_apply", "message"), reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text=str(locale("sponsor_apply", "button")), callback_data=f"sponsor_apply_{msg.from_user.id}")]]), quote=should_quote(msg))
else:
await msg.reply_text(locale("sponsorship_application_empty", "message"))
2022-12-10 11:42:56 +02:00
# ==============================================================================================================================