From ee6653c0c6c09a5a38d1c1ef2be5318edfbe2e14 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Thu, 6 Jan 2022 07:13:57 -0500 Subject: /d / /s / /search commands refactoring --- telegram/utils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'telegram/utils.go') diff --git a/telegram/utils.go b/telegram/utils.go index 4c73f9e..bddffc8 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -616,3 +616,13 @@ func (c *Client) roster(resource string) { c.addResource(resource) } + +func (c *Client) getLastMessages(id int64, query string, from int64, count int32) (*client.Messages, error) { + return c.client.SearchChatMessages(&client.SearchChatMessagesRequest{ + ChatID: id, + Query: query, + Sender: &client.MessageSenderUser{UserID: from}, + Filter: &client.SearchMessagesFilterEmpty{}, + Limit: count, + }) +} -- cgit v1.2.3