gramjs icon indicating copy to clipboard operation
gramjs copied to clipboard

Feature request: expose sendAs in client.sendMessage

Open zeynalnia opened this issue 7 months ago • 0 comments

Problem

The TL schema for messages.sendMessage already supports send_as:flags.13?InputPeer (api.tl, layer 193: messages.sendMessage#983f9745 ... send_as:flags.13?InputPeer ...), but the high-level wrapper client.sendMessage does not expose this option. To send a message as a channel, anonymous admin, or other peer, callers currently have to drop down to client.invoke(new Api.messages.SendMessage(...)) manually.

Proposal

Add an optional sendAs?: EntityLike field to SendMessageParams in gramjs/client/messages.ts. When provided, resolve it via client.getInputEntity and forward to Api.messages.SendMessage({ sendAs: ... }).

Notes

  • This mirrors how Pyrogram/Telethon expose the same option.
  • Scope is intentionally limited to the no-file path; sendFile would need a separate change to thread sendAs through messages.SendMedia.

zeynalnia avatar Apr 19 '26 06:04 zeynalnia