Skip to main content

send_message

AsyncMethod
This is a method of the BotProtocol class in the protocols module.
Send a message to a channel.

Signature

Parameters

str
required
Target channel ID
Union
required
Message content
Optional[str]
Optional message ID to reply to
Optional[str]
Optional thread ID for threaded replies

Returns

Union[BotMessage, 'SendResult']
class:~praisonaiagents.bots.SendResult — the transport-neutral receipt that carries a closed, branchable status ("sent" / "failed" / "queued" / "duplicate"), the platform message_id/message_ids (for edit-in-place, delete and threading), and a classified error/error_kind on failure. This makes a silent drop unrepresentable: a caller can branch on result.status instead of relying on an exception that may be swallowed.A legacy :class:BotMessage remains an accepted return for backward compatibility — treat a returned BotMessage as a successful send (status == "sent").

Source

View on GitHub

praisonaiagents/bots/protocols.py at line 927