aboutsummaryrefslogtreecommitdiff
path: root/telegram/utils.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-01-06 15:13:57 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-01-06 15:13:57 +0300
commitee6653c0c6c09a5a38d1c1ef2be5318edfbe2e14 (patch)
treedb8b5d9b0a0642b0e930e7a1caa8b34a3df0a551 /telegram/utils.go
parent570601d1b8aaaa82b4e618d84a9a95095ed5791a (diff)
/d / /s / /search commands refactoring
Diffstat (limited to 'telegram/utils.go')
-rw-r--r--telegram/utils.go10
1 files changed, 10 insertions, 0 deletions
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,
+ })
+}