Skip to content

Conversation

LogicalOgbonna
Copy link

@LogicalOgbonna LogicalOgbonna commented Apr 21, 2025

PR Details

This PR allows users to post text stories (broadcasts)

Description

This is a feature that lets users post to their stories; only text-based stories are functional and tested.

Related Issue(s)

#3373 #3398 #2371

Motivation and Context

Automating story (status) posting, shoutout to @tofers

How Has This Been Tested

   it('should be able to post text status (stories)', async function () {
        this.timeout(35000);
        const status = await client.sendStatus('Hello World!');
        expect(typeof status).to.equal('object');
        expect(status.messageSendResult).to.equal('OK');
    });

How to test this PR yourself

npm install github:LogicalOgbonna/whatsapp-web.js#main

inside your index.js

const { Client, LocalAuth, MessageMedia } = require("whatsapp-web.js");
const qrcode = require('qrcode-terminal');

const client = new Client({
  puppeteer: {
    headless: true,
  },
  authStrategy: new LocalAuth(),
});

client.initialize();

client.on("qr", (qr) => {
    qrcode.generate(qr, {small: true});
});

client.on("authenticated", (session) => {
  console.log(JSON.stringify(session));
});

client.on("ready", async () => {
  const status = await client.sendStatus("Hello world!", {});
  console.log(status);
});

Environment

  • Machine OS: macOs
  • Phone OS: Android
  • Library Version: 1.27.0

Types of changes

  • Dependency change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (index.d.ts).
  • I have updated the usage example accordingly (example.js)

@LogicalOgbonna LogicalOgbonna changed the title Add status (stories) feature with text Feature: Added support for posting text based status (stories) Apr 21, 2025
@LogicalOgbonna LogicalOgbonna mentioned this pull request Apr 21, 2025
2 tasks
@firsttabz
Copy link

Your method for media ist not working.

@firsttabz
Copy link

You can send status but only text

@firsttabz
Copy link

You can send status but only text.

@tuyuribr
Copy link
Collaborator

Why don't inject on the sendMessage/sendMedia function ?

@tuyuribr
Copy link
Collaborator

tuyuribr commented Jun 10, 2025

The color change function is cool, maybe just a option for the sendMessage function, them send to @ broadcast

Copy link
Contributor

@alechkos alechkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please combine the functionality with Client.sendMessage function so we could send a status something like this:

await client.sendMessage(chatId, 'Status text', { sendAsStatus: true });

@RC047
Copy link
Contributor

RC047 commented Sep 11, 2025

Is there any update regarding this pull request? Because this feature can be very useful if it can send messages into stories.

@RC047 RC047 mentioned this pull request Sep 19, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants