Skip to content

Helpers to reply to messages #576

@noplanman

Description

@noplanman

Would be a nice addition to add shortcuts to reply to messages in commands:

This would be especially helpful when there are various conditions when replying to a certain command. Having to set the $data array every time seems overly cumbersome.

Basically this:

$this->replyToChat('My reply text', $data_array_for_any_extras);

vs.

$data = [
    'chat_id' => $this->getMessage()->getChat()->getId(),
    'text'   => 'My reply text',
    // any extras, like keyboard, parse mode, etc.
];
Request::sendMessage($data);

Also:

$this->replyToUser(...); // Which sounds better than `replyToFrom` I guess?

Not sure about other entity types, like replying with a photo or document etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions