MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / on_message

Method on_message

camel/bots/telegram_bot.py:66–82  ·  view source on GitHub ↗

r"""Handles incoming messages from the user. Args: message (types.Message): The incoming message object.

(self, message: 'Message')

Source from the content-addressed store, hash-verified

64 self.bot.infinity_polling()
65
66 def on_message(self, message: 'Message') -> None:
67 r"""Handles incoming messages from the user.
68
69 Args:
70 message (types.Message): The incoming message object.
71 """
72 self.chat_agent.reset()
73
74 if not message.text:
75 return
76
77 user_msg = BaseMessage.make_user_message(
78 role_name="User", content=message.text
79 )
80 assistant_response = self.chat_agent.step(user_msg)
81
82 self.bot.reply_to(message, assistant_response.msg.content)

Callers

nothing calls this directly

Calls 3

resetMethod · 0.45
make_user_messageMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected