gramjs
gramjs copied to clipboard
Feature request: expose sendAs in client.sendMessage
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;
sendFilewould need a separate change to threadsendAsthroughmessages.SendMedia.