Open Dhruv-Tara opened 9 months ago
I assume that this is your channel id. Since it has a negative value.
peer = {
_: 'inputPeerChannel',
channel_id: -1001844107989,
};
It is a supergroup.
@Dhruv-Tara
It is a supergroup.
Supergroups are also considered channels.
Also, the values for IDs (which in telegram docs are considered long
) should be typed as a string, not as a number because of the way this package handles bigints (64-bit numbers)
Anyone can help me.
I have got this error
{
_: 'mt_rpc_error',
error_code: 400,
error_message: 'CHANNEL_INVALID'
}
@asror797 check the validity of your access_hash
. Each access_hash
is unique for both the channel and the current user, which means you have to have it obtained from another Telegram API method, such as dialogs.getDialogs
.
Also, I'm not 100% sure about this, but try to remove the -100
from your channel ID, as it is (for some reason) only used for bots. They might've changed it though so I'm not sure about this.
I was trying to create a app for my project and when I used the SendMessage method it returned peer id invalid all the id and code was correct
api.call('messages.sendMessage', { clear_draft: true,
peer: { _: 'inputPeerChat', chat_id : -1001844107989 }, message: 'Hello', random_id: 1990, })