Skip to content

Feature request: expose sendAs in client.sendMessage #827

@zeynalnia

Description

@zeynalnia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions