Initial commit
This commit is contained in:
62
main.py
Normal file
62
main.py
Normal file
@@ -0,0 +1,62 @@
|
||||
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())
|
||||
Reference in New Issue
Block a user