Open Ray-Garraty opened 3 years ago
The error object is something like this:
{ _: 'mt_rpc_error', error_code: 400, error_message: 'CHANNEL_INVALID' }
but you're using error.message instead of error.error_message that's the reason you're getting undefined.
the rest of the code is ok (make sure to pass a valid channel_id and access_hash)
Update the library to version 6 and try using the code from the documentation - https://mtproto-core.js.org/docs/call-the-telegram-methods#parse-all-messages-from-channel
Hi! I'm starting to learn Telegram API, and need your advice. I want to get full info about channel using the api method 'channels.getFullChannel':
const params = { channel: { _: 'inputChannel', channel_id: -1001003399994, access_hash: 4872913646325428232, }, }; mtproto .call('channels.getFullChannel', params) .then(console.log) .catch((error) => { console.error(error.message); process.exit(1); });
For some mysterious reason it throws an error and exits. And I receive only 'undefined', not result or error message...
i try to get the users from a channel but i am getting unkown error.
Hi! I'm starting to learn Telegram API, and need your advice. I want to get full info about channel using the api method 'channels.getFullChannel':
For some mysterious reason it throws an error and exits. And I receive only 'undefined', not result or error message...