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.
Problem
The TL schema for
messages.sendMessagealready supportssend_as:flags.13?InputPeer(api.tl, layer 193:
messages.sendMessage#983f9745 ... send_as:flags.13?InputPeer ...),but the high-level wrapper
client.sendMessagedoes not expose this option. To senda 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?: EntityLikefield toSendMessageParamsingramjs/client/messages.ts. When provided, resolve it viaclient.getInputEntityand forward to
Api.messages.SendMessage({ sendAs: ... }).Notes
sendFilewould need a separatechange to thread
sendAsthroughmessages.SendMedia.