mirror of
https://github.com/usememos/memos.git
synced 2024-11-30 22:14:19 +03:00
9987337eca
Fix all ID from int to int64 to avoid 32bits machine break
25 lines
543 B
Go
25 lines
543 B
Go
package telegram
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
"strconv"
|
|
)
|
|
|
|
// SendReplyMessage make a sendMessage api request.
|
|
func (b *Bot) SendReplyMessage(ctx context.Context, chatID, replyID int64, text string) (*Message, error) {
|
|
formData := url.Values{
|
|
"reply_to_message_id": {strconv.FormatInt(replyID, 10)},
|
|
"chat_id": {strconv.FormatInt(chatID, 10)},
|
|
"text": {text},
|
|
}
|
|
|
|
var result Message
|
|
err := b.postForm(ctx, "/sendMessage", formData, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &result, nil
|
|
}
|