Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messages.GetDialogs() #86

Closed
YabberWalkie opened this issue May 26, 2021 · 2 comments
Closed

messages.GetDialogs() #86

YabberWalkie opened this issue May 26, 2021 · 2 comments

Comments

@YabberWalkie
Copy link

YabberWalkie commented May 26, 2021

I'm trying to retreive all dialogs, but i keep getting an error message

(async function run() {
    const result: Api.messages.Dialogs = await client.invoke(new Api.messages.GetDialogs();
    console.log(result); // prints the result
})();

node:65944 UnhandledPromiseRejectionWarning: Error: Cannot cast undefined to any kind of undefined
at _raiseCastFail (\node_modules\telegram\Utils.js:21:11)
at Object.getPeer (\node_modules\telegram\Utils.js:836:9)
at Object. (\node_modules\telegram\client\users.js:242:26)
at Generator.next ()
at \node_modules\telegram\client\users.js:8:71
at new Promise ()
at __awaiter (\node_modules\telegram\client\users.js:4:12)
at Object.getInputEntity (\node_modules\telegram\client\users.js:198:12)
at TelegramClient.getInputEntity (\node_modules\telegram\client\TelegramClient.js:198:28)
at \node_modules\telegram\tl\api.js:129:56

@painor
Copy link
Member

painor commented May 26, 2021

if you'd want to use Raw API. then you'd need to pass all the needed params.
https://gram.js.org/tl/messages/GetDialogs

for the offsetPeer you can pass new InputPeerEmpty({})

@painor
Copy link
Member

painor commented Jun 5, 2021

a new friendly client.getDialogs method exists now. you can use that

@painor painor closed this as completed Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants