Restore sendChatScreenshotTakenNotification

This commit is contained in:
c0re100 2023-08-30 03:53:53 +08:00
parent 0b8a2f54dd
commit 26f72d96ce
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1579 additions and 1550 deletions

View file

@ -1736,7 +1736,7 @@ type GetTopChatsRequest struct {
Limit int32 `json:"limit"`
}
// Returns a list of frequently used chats. Supported only if the chat info database is enabled
// Returns a list of frequently used chats
func (client *Client) GetTopChats(req *GetTopChatsRequest) (*Chats, error) {
result, err := client.Send(Request{
meta: meta{
@ -3327,6 +3327,32 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err
return UnmarshalMessages(result.Data)
}
type SendChatScreenshotTakenNotificationRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
}
// Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats
func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreenshotTakenNotificationRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "sendChatScreenshotTakenNotification",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type AddLocalMessageRequest struct {
// Target chat
ChatId int64 `json:"chat_id"`