DiscordPHP-BridgeBot Documentation

Editing

A connector whose network lets a message already sent be rewritten.

Telegram does; IRC does not, and no amount of wishing makes it. A relay that assumed every network could edit would have to fall back to posting a second copy on the ones that cannot, which is worse than leaving the original alone — so the relay asks instead of assuming, and a network without this capability simply never hears about an edit.

Implementing this is a promise that Connector::relay() resolves to the id of what it sent, because that id is what an edit is addressed to.

Tags
author

Valithor Obsidion valithor@discordphp.org

Table of Contents

Methods

edit()  : PromiseInterface
Rewrites a message this bot relayed, to what the Discord original now says.

Methods

edit()

Rewrites a message this bot relayed, to what the Discord original now says.

public edit(string $target, string $messageId, Outgoing $message) : PromiseInterface

The whole Outgoing comes rather than finished text, for the same reason Connector::relay() takes one: rendering it is the connector's business.

Rejects when the message is too old to edit, was deleted, or the network refuses for its own reasons; the caller leaves it be rather than retry.

Parameters
$target : string
$messageId : string
$message : Outgoing
Return values
PromiseInterface
On this page

Search results