🌙

getMe

getMe

Возвращает информацию о боте.

me = await bot.get_me()

Возвращает: User

ПолеТипОписание
idintID бота
is_botboolВсегда True для ботов
first_namestrИмя бота
usernamestr или None@username

Пример

import asyncio
from pykodaribot import Bot

async def main():
    bot = Bot("bot_ВАШ_ТОКЕН")
    me = await bot.get_me()
    print(f"Бот: {me.first_name} (@{me.username}), ID={me.id}")
    await bot.close()

asyncio.run(main())
1 просмотр