Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
pip install -U agno httpx
export TELEGRAM_TOKEN=***
from agno.agent import Agent from agno.tools.telegram import TelegramTools # 如何获取 token 和 chat_id: # 1. 在 Telegram 上使用 BotFather 创建一个新机器人。https://core.telegram.org/bots/features#creating-a-new-bot # 2. 从 BotFather 获取 token。 # 3. 向机器人发送消息。 # 4. 通过访问以下 URL 获取 chat_id: # https://api.telegram.org/bot/<your-bot-token>/getUpdates telegram_token = "<enter-your-bot-token>" chat_id = "<enter-your-chat-id>" agent = Agent( name="telegram", tools=[TelegramTools(token=telegram_token, chat_id=chat_id)], ) agent.print_response("向 Telegram 聊天发送一段关于月球的文字")
token
Optional[str]
None
chat_id
Union[str, int]
send_message