Spaces:
Paused
Paused
Download bot/plugins/deeplinks.py from privateone/telethon_upload: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/spaces/privateone/telethon_upload/resolve/main/bot/plugins/deeplinks.py
- Command line
-
hf download hf://spaces/privateone/telethon_upload/bot/plugins/deeplinks.py
-
curl -L -o deeplinks.py https://huggingface.co/spaces/privateone/telethon_upload/resolve/main/bot/plugins/deeplinks.py
764 Bytes
| from telethon.events import NewMessage | |
| from telethon.tl.custom import Message | |
| from bot import TelegramBot | |
| from bot.modules.decorators import verify_user | |
| from bot.modules.telegram import get_message, send_message | |
| from bot.modules.static import * | |
| #@verify_user(private=True) | |
| async def send_file(event: NewMessage.Event | Message): | |
| payload = event.raw_text.split()[-1].split('_') | |
| if len(payload) != 3: | |
| return await event.reply(InvalidPayloadText) | |
| message = await get_message(int(payload[1])) | |
| if not message: | |
| return await event.reply(MessageNotExist) | |
| message.raw_text = '' | |
| await send_message(message, send_to=event.chat_id) | |