mirror of
https://github.com/usememos/memos.git
synced 2024-12-25 12:23:09 +03:00
22 lines
422 B
Go
22 lines
422 B
Go
|
package telegram
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net/url"
|
||
|
)
|
||
|
|
||
|
// AnswerCallbackQuery make an answerCallbackQuery api request.
|
||
|
func (b *Bot) AnswerCallbackQuery(ctx context.Context, callbackQueryID, text string) error {
|
||
|
formData := url.Values{
|
||
|
"callback_query_id": {callbackQueryID},
|
||
|
"text": {text},
|
||
|
}
|
||
|
|
||
|
err := b.postForm(ctx, "/answerCallbackQuery", formData, nil)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|