Closed danielehrhardt closed 2 years ago
Describe the bug I try to send a message to a User from a Group that i have never messaged before. If i try, i get invalid peer id. It works when i started a chat with the person in telegram before.
Code example
const fullChat = await this.api.call('messages.getFullChat', { chat_id: this.selectedChat, }); console.log('fullChat', fullChat); if (fullChat) { await Promise.all( fullChat.users.map(async (_) => { console.log('sendMessage -> ', _, this.message); await this.api.call('messages.sendMessage', { clear_draft: true, peer: { _: 'inputPeerUser', user_id: _.id, }, message: this.message, random_id: Math.ceil(Math.random() * 0xffffff) + Math.ceil(Math.random() * 0xffffff), }); await this.sleep((Math.floor(Math.random() * 10) + 1) * 100); return _; }) ); }
Expected behavior Send Message to User without a existing Chat.
Added access_hash to the sendMessage
Describe the bug I try to send a message to a User from a Group that i have never messaged before. If i try, i get invalid peer id. It works when i started a chat with the person in telegram before.
Code example
Expected behavior Send Message to User without a existing Chat.