Skip to content

Feature: Added support for posting text based status (stories) #3528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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

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.

3 participants