mirror of
https://github.com/usememos/memos.git
synced 2024-11-17 04:07:30 +08:00
845297ec03
* Change all `Robot` to `Bot` * Change all `r` of `Bot` to `b` * Change `Robot` to `bot` in comments * Fix typo --------- Co-authored-by: Athurg Feng <athurg@gooth.org>
24 lines
499 B
Go
24 lines
499 B
Go
package telegram
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
"strconv"
|
|
)
|
|
|
|
// EditMessage make an editMessageText api request.
|
|
func (b *Bot) EditMessage(ctx context.Context, chatID, messageID int, text string) (*Message, error) {
|
|
formData := url.Values{
|
|
"message_id": {strconv.Itoa(messageID)},
|
|
"chat_id": {strconv.Itoa(chatID)},
|
|
"text": {text},
|
|
}
|
|
|
|
var result Message
|
|
err := b.postForm(ctx, "/editMessageText", formData, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &result, nil
|
|
}
|