mirror of
https://github.com/usememos/memos.git
synced 2024-11-17 04:07:30 +08:00
9987337eca
Fix all ID from int to int64 to avoid 32bits machine break
24 lines
543 B
Go
24 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
|
|
}
|