Download plugins/caption_cmds.py from Thaimozhi/RenameBot: direct link, hf CLI and curl.
- Browser
- Download file 2.5 kB
-
https://huggingface.co/spaces/Thaimozhi/RenameBot/resolve/main/plugins/caption_cmds.py
- Command line
-
hf download hf://spaces/Thaimozhi/RenameBot/plugins/caption_cmds.py
-
curl -L -o caption_cmds.py https://huggingface.co/spaces/Thaimozhi/RenameBot/resolve/main/plugins/caption_cmds.py
2.5 kB
| from pyrogram import Client, filters | |
| from pyrogram.types import Message | |
| from helper.database import codeflixbots | |
| async def set_caption(client, message): | |
| if len(message.command) == 1: | |
| return await message.reply_text("Usage: `/set_caption [your custom caption template]`") | |
| caption = message.text.split(" ", 1)[1] | |
| await codeflixbots.set_caption(message.chat.id, caption) | |
| await message.reply_text(f"**Caption set successfully:**\n\n{caption}") | |
| async def see_caption(client, message): | |
| caption = await codeflixbots.get_caption(message.chat.id) | |
| if caption: | |
| await message.reply_text(f"**Your Current Caption Template:**\n\n{caption}") | |
| else: | |
| await message.reply_text("**You have not set any custom caption yet.**") | |
| async def del_caption(client, message): | |
| await codeflixbots.set_caption(message.chat.id, None) | |
| await message.reply_text("**Custom caption cleared!**") | |
| async def set_prefix(client, message): | |
| if len(message.command) == 1: | |
| return await message.reply_text("Usage: `/set_prefix [your prefix text]`\nThis will be attached at the top of your custom caption.") | |
| prefix = message.text.split(" ", 1)[1] | |
| await codeflixbots.set_prefix(message.chat.id, prefix) | |
| await message.reply_text(f"**Prefix set successfully:**\n\n{prefix}") | |
| async def del_prefix(client, message): | |
| await codeflixbots.set_prefix(message.chat.id, None) | |
| await message.reply_text("**Custom prefix cleared!**") | |
| async def set_suffix(client, message): | |
| if len(message.command) == 1: | |
| return await message.reply_text("Usage: `/set_suffix [your suffix text]`\nThis will be attached at the bottom of your custom caption.") | |
| suffix = message.text.split(" ", 1)[1] | |
| await codeflixbots.set_suffix(message.chat.id, suffix) | |
| await message.reply_text(f"**Suffix set successfully:**\n\n{suffix}") | |
| async def del_suffix(client, message): | |
| await codeflixbots.set_suffix(message.chat.id, None) | |
| await message.reply_text("**Custom suffix cleared!**") | |