|
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() |
|
|
|
@dp.message(Command("start")) |
|
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()) |
|
|