messages.getDialogs
Returns the current user dialog list.
func (c *Client) MessagesGetDialogs(ctx context.Context, request *MessagesGetDialogsRequest) (MessagesDialogsClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesGetDialogs(ctx, &tg.MessagesGetDialogsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // MessagesDialogsClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ExcludePinned | bool | — | Exclude pinned dialogs |
FolderID | int | — | Peer folder ID, for more info click here |
OffsetDate | int | yes | Offsets for pagination, for more info click here |
OffsetID | int | yes | Offsets for pagination, for more info click here (top_message ID used for pagination) |
OffsetPeer | InputPeerClass | yes | Offset peer for pagination |
Limit | int | yes | Number of list elements to be returned |
Hash | int64 | yes | Hash used for caching, for more info click here |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_NOT_MODIFIED | No changes were made to chat information because the new information you passed is identical to the current information. |
| 403 | CHAT_WRITE_FORBIDDEN | You can't write in this chat. |
| 400 | FOLDER_ID_INVALID | Invalid folder ID. |
| 400 | OFFSET_PEER_ID_INVALID | The provided offset peer is invalid. |
| 400 | PINNED_DIALOGS_TOO_MUCH | Too many pinned dialogs. |
| 400 | TAKEOUT_INVALID | The specified takeout ID is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.getDialogs#a0f4cb4f