62 lines
1.1 KiB
Python
62 lines
1.1 KiB
Python
from aiogram import Bot, Dispatcher, F
|
|
from aiogram.enums import ParseMode
|
|
from aiogram.filters import Command
|
|
from aiogram.types import Message
|
|
from aiogram.client.default import DefaultBotProperties
|
|
import asyncio
|
|
|
|
bot = Bot(
|
|
token=BOT_TOKEN,
|
|
default=DefaultBotProperties(parse_mode=ParseMode.HTML)
|
|
)
|
|
|
|
dp = Dispatcher()
|
|
|
|
def is_admin(user_id: int) -> bool:
|
|
return user_id in ADMINS
|
|
|
|
@dp.message(Command("help"))
|
|
async def help_command(message: Message):
|
|
|
|
if not is_admin(message.from_user.id):
|
|
return
|
|
|
|
help_text = """
|
|
<b>Bold text</b>
|
|
|
|
<i>Italic text</i>
|
|
|
|
<u>Underlined text</u>
|
|
|
|
<s>Strikethrough text</s>
|
|
|
|
<tg-spoiler>Spoiler text</tg-spoiler>
|
|
|
|
<code>Mono font / inline code</code>
|
|
|
|
<pre>
|
|
Multi-line
|
|
mono block
|
|
</pre>
|
|
|
|
<b><i>Bold + Italic</i></b>
|
|
|
|
Line 1
|
|
Line 2
|
|
Line 3
|
|
|
|
<a href="https://telegram.org">Clickable URL</a>
|
|
"""
|
|
|
|
await message.answer(help_text)
|
|
|
|
@dp.message(Command("start"))
|
|
async def start_command(message: Message):
|
|
await message.answer("Bot is running.")
|
|
|
|
async def main():
|
|
print("Bot started.")
|
|
await dp.start_polling(bot)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main()) |