mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: set memo visibility in telegram (#1824)
* Add telegram.Bot in MessageHandler * Change single message handler like group messages * Move message notify wrapper from plugin to server * Add keyboard buttons on Telegram reply message * Add support to telegram CallbackQuery update * Set visibility in callbackQuery * Change original reply message after callbackQuery --------- Co-authored-by: Athurg Feng <athurg@gooth.org>
This commit is contained in:
21
plugin/telegram/api_answer_callback_query.go
Normal file
21
plugin/telegram/api_answer_callback_query.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user