Download bot.py from dragxd/beckend: direct link, hf CLI and curl.
- Browser
- Download file 895 Bytes
-
https://huggingface.co/spaces/dragxd/beckend/resolve/main/bot.py
- Command line
-
hf download hf://spaces/dragxd/beckend/bot.py
-
curl -L -o bot.py https://huggingface.co/spaces/dragxd/beckend/resolve/main/bot.py
895 Bytes
| import asyncio | |
| import os | |
| from aiogram import Bot, Dispatcher, types | |
| from aiogram.filters import Command | |
| from aiogram.enums import ParseMode | |
| from aiogram.client.default import DefaultBotProperties | |
| from aiogram.types import WebAppInfo | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| BOT_TOKEN = os.getenv("BOT_TOKEN") | |
| bot = Bot(token=BOT_TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) | |
| dp = Dispatcher() | |
| async def start_handler(message: types.Message): | |
| kb = [[ | |
| types.InlineKeyboardButton( | |
| text="🛠 Rename a File", | |
| web_app=WebAppInfo(url="https://file-renamer-ui.vercel.app") | |
| ) | |
| ]] | |
| await message.answer("Click below to rename a file", reply_markup=types.InlineKeyboardMarkup(inline_keyboard=kb)) | |
| async def main(): | |
| await dp.start_polling(bot) | |
| if __name__ == "__main__": | |
| asyncio.run(main()) | |