alik0211/mtproto-core

messages.SendMessage not working as expected

Dhruv-Tara opened this issue · 6 comments

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,
})

image

I assume that this is your channel id. Since it has a negative value.

peer = {
  _: 'inputPeerChannel',
  channel_id: -1001844107989,
};

It is a supergroup.