Skip to content

Commit

Permalink
Update commands.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MRK-YT authored Jun 4, 2021
1 parent ebaf06f commit 4da8632
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bot/plugins/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@
# -*- coding: utf-8 -*-
# (c) @AlbertEinsteinTG & @Mrk_YT

from pyrogram import filters, Client
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, CallbackQuery
from bot import Translation # pylint: disable=import-error
from bot.database import Database # pylint: disable=import-error

db = Database()

@Client.on_message(filters.command(["start"]) & filters.private, group=1)
async def start(bot, update):

try:
file_uid = update.command[1]
except IndexError:
file_uid = False

if file_uid:
file_id, file_name, file_caption, file_type = await db.get_file(file_uid)

if (file_id or file_type) == None:
return

caption = file_caption if file_caption != ("" or None) else ("<code>" + file_name + "</code>")

if file_type == "document":

await bot.send_document(
chat_id=update.chat.id,
Expand Down

0 comments on commit 4da8632

Please sign in to comment.