pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
14.96k stars 3.55k forks source link

Bug When sending a message to the channel #2551

Open Inaciooooo opened 11 months ago

Inaciooooo commented 11 months ago

Is there an existing issue for this?

Describe the bug

Quando tento enviar mensagem para algum canal ele simplesmente da em nada como se não estivesse executado o codigo exemplo de como uso client.sendMessage("120363168650684996@newsletter", "teste123");

Expected behavior

Não sei

Steps to Reproduce the Bug or Issue

.

Relevant Code

client.sendMessage("120363168650684996@newsletter", "👽");

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

.

Additional context

.

alechkos commented 9 months ago

@Inaciooooo

In progress...

techenthusiast8630 commented 9 months ago

@alechkos is this bug fixed?

alechkos commented 9 months ago

@chirag3232

is this bug fixed?

it will be fixed as soon as i finish the pr

techenthusiast8630 commented 9 months ago

@alechkos how much time will it take? approximately?

alechkos commented 9 months ago

@techenthusiast8630 @Inaciooooo

You can test it in the meantime, but it's still a work in progress Supported message types to send are: text, image and video

npm install github:alechkos/whatsapp-web.js#channels
const myChannelId = (await client.createChannel('MyChannel'))?.nid._serialized;
if (myChannelId) {
    const sentMsg = await client.sendMessage(myChannelId, msg);
    console.log(sentMsg);
} else console.log('Channels are not supported in your country');
alechkos commented 9 months ago

@techenthusiast8630 @Inaciooooo

The sendMessage method for channels has been fixed. Currently, supported message types to send are: text, image, sticker, gif, or video.

Don't forget to reapply the PR:

npm install github:alechkos/whatsapp-web.js#channels