-// SendMessage sends text to chat as plain text, with no parse mode.
-func (b *botAPI) SendMessage(ctx context.Context, chat int64, text string) error {
- return b.call(ctx, "sendMessage", map[string]any{
+// SendMessage sends text to chat with the format of entities, with no parse
+// mode, so the text needs no escaping. With no entities, the text is plain. A
+// call that takes longer than sendTimeout fails with errBotNetwork.
+func (b *botAPI) SendMessage(ctx context.Context, chat int64, text string, entities []botEntity) error {
+ ctx, cancel := context.WithTimeout(ctx, b.sendTimeout)
+ defer cancel()
+
+ params := map[string]any{