mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
525 B
Go
25 lines
525 B
Go
2 years ago
|
package telegram
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net/url"
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
|
// SendReplyMessage make a sendMessage api request.
|
||
|
func (r *Robot) SendReplyMessage(ctx context.Context, chatID, replyID int, text string) (*Message, error) {
|
||
|
formData := url.Values{
|
||
|
"reply_to_message_id": {strconv.Itoa(replyID)},
|
||
|
"chat_id": {strconv.Itoa(chatID)},
|
||
|
"text": {text},
|
||
|
}
|
||
|
|
||
|
var result Message
|
||
|
err := r.postForm(ctx, "/sendMessage", formData, &result)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return &result, nil
|
||
|
}
|