Skip to main content
Proactive push does not depend on the reply target of Sender. You need to specify the target IM, group, or user. For group push, pass groupCode; for private push, pass userID.

Function overview

push(...)

str
required
Target IM type, such as qq, weixin, or qx, depending on enabled adapters.
str
required
Group ID. Required for group push; pass an empty string for private push.
str
required
User ID. Required for private push; can be empty for group push.
str
Target account ID. Also accepted as accountID or accountId. Explicit values have highest priority.
int
Request timeout. Pass milliseconds.

Push account selection

These rules apply to push(...), pushImage(...), pushVoice(...), pushVideo(...), pushFile(...), and pushMixed(...). Selection rules:
  1. If options contains account_id, use it.
  2. If this is a message trigger and the target IM is the same as the current chat IM, use the current chat account by default.
  3. If this is cron / fake, use the target IM default account.
  4. For cross-IM push, use the target IM default account.
  5. If the target IM has no default account, the runtime chooses the first online account that can send. If no account can send, it returns 0 or raises an adapter offline error.
When you know the sending account, pass options.account_id explicitly. It is more stable than depending on the current chat account or target IM default account.

Media push

All proactive push helpers support options and timeout. Use options.account_id / accountID / accountId to choose the sending account explicitly. Use filename / fileName / file_name and mimeType / mime_type to add media metadata.

Return value

Proactive push returns the number of successfully sent targets, usually 0 or 1. If the adapter returns an error, the SDK raises Exception.

Next steps

Last modified on June 3, 2026