Skip to main content

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

NameTypeRequiredDescription
ExcludePinnedboolExclude pinned dialogs
FolderIDintPeer folder ID, for more info click here
OffsetDateintyesOffsets for pagination, for more info click here
OffsetIDintyesOffsets for pagination, for more info click here (top_message ID used for pagination)
OffsetPeerInputPeerClassyesOffset peer for pagination
LimitintyesNumber of list elements to be returned
Hashint64yesHash used for caching, for more info click here

Returns

MessagesDialogsClass

Possible errors

CodeTypeDescription
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400FOLDER_ID_INVALIDInvalid folder ID.
400OFFSET_PEER_ID_INVALIDThe provided offset peer is invalid.
400PINNED_DIALOGS_TOO_MUCHToo many pinned dialogs.
400TAKEOUT_INVALIDThe specified takeout ID is invalid.

References