Skip to content

Commit 95b2cdc

Browse files
committed
[WAHA] Provide Participants for Status message
1 parent ba90b35 commit 95b2cdc

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

send.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ type SendRequestExtra struct {
148148
MediaHandle string
149149

150150
Meta *types.MsgMetaInfo
151+
152+
// When sending status message you can specify the recipients
153+
Participants []types.JID
151154
}
152155

153156
// SendMessage sends the given message.
@@ -301,10 +304,14 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
301304
extraParams.addressingMode = types.AddressingModePN
302305
}
303306
} else {
304-
groupParticipants, err = cli.getBroadcastListParticipants(ctx, to)
305-
if err != nil {
306-
err = fmt.Errorf("failed to get broadcast list members: %w", err)
307-
return
307+
if len(req.Participants) != 0 {
308+
groupParticipants = req.Participants
309+
} else {
310+
groupParticipants, err = cli.getBroadcastListParticipants(ctx, to)
311+
if err != nil {
312+
err = fmt.Errorf("failed to get broadcast list members: %w", err)
313+
return
314+
}
308315
}
309316
}
310317
resp.DebugTimings.GetParticipants = time.Since(start)

0 commit comments

Comments
 (0)