forked from TEAM-PYRO-BOTZ/PYRO-RENAME-BOT
-
Notifications
You must be signed in to change notification settings - Fork 1
/
thumbfuc.py
24 lines (20 loc) · 1.22 KB
/
thumbfuc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pyrogram import Client, filters
from helper.database import db
@Client.on_message(filters.private & filters.command(['viewthumb']))
async def viewthumb(client, message):
thumb = await db.get_thumbnail(message.from_user.id)
if thumb:
await client.send_photo(
chat_id=message.chat.id,
photo=thumb)
else:
await message.reply_text("😔 __**𝚈𝙾𝚄 𝙳𝙾𝙽𝚃 𝙷𝙰𝚅𝙴 𝙰𝙽𝚈 𝚃𝙷𝚄𝙼𝙱𝙽𝙰𝙸𝙻**__")
@Client.on_message(filters.private & filters.command(['delthumb']))
async def removethumb(client, message):
await db.set_thumbnail(message.from_user.id, file_id=None)
await message.reply_text("❌️ __**𝚈𝙾𝚄𝚁 𝚃𝙷𝚄𝙼𝙱𝙽𝙰𝙸𝙻 𝚂𝚄𝙲𝙲𝙴𝚂𝚂𝙵𝚄𝙻𝙻𝚈 𝙳𝙴𝙻𝙴𝚃𝙴𝙳**__")
@Client.on_message(filters.private & filters.photo)
async def addthumbs(client, message):
mkn = await message.reply_text("Please Wait ...")
await db.set_thumbnail(message.from_user.id, file_id=message.photo.file_id)
await mkn.edit("✅️ __**𝚈𝙾𝚄𝚁 𝚃𝙷𝚄𝙼𝙱𝙽𝙰𝙸𝙻 𝚂𝚄𝙲𝙲𝙴𝚂𝚂𝚂𝙵𝚄𝙻𝙻𝚈 𝚂𝙰𝚅𝙴𝙳**__")