DiscordPHP-BridgeBot Documentation

BridgeCheck
in package

FinalYes

Turns the result of the startup check into something a human can act on.

A bridge is a pair of ends that outlive the process, and either can stop working while the bot is down: the Discord channel can be deleted, the bot can be removed from the server, or the room on the other network can be renamed, deleted or closed to it. None of that produces an error at startup — it produces a bridge that quietly relays nothing, which is indistinguishable from "nobody has said anything".

So each restored bridge is probed once, and anything broken is named. Pure, so the wording and the counting can be tested without a socket.

Nothing is pruned automatically. A guild can be briefly unavailable during a Discord outage, and deleting somebody's configuration because of a bad ten seconds is far worse than logging a line they can act on.

Tags
author

Valithor Obsidion valithor@discordphp.org

Table of Contents

Methods

describe()  : string|null
What is wrong with one bridge, or `null` when it is fine.
restored()  : string
The startup line for a working bridge set: what was restored, and from where.
summarise()  : array{healthy: int, problems: list}
One line per broken bridge, plus how many are healthy.

Methods

describe()

What is wrong with one bridge, or `null` when it is fine.

public static describe(array{connector: string, channel_id: string, target: string, channel_ok: bool, target_ok: bool, joined: bool} $row) : string|null
Parameters
$row : array{connector: string, channel_id: string, target: string, channel_ok: bool, target_ok: bool, joined: bool}
Return values
string|null

restored()

The startup line for a working bridge set: what was restored, and from where.

public static restored(int $bridges, int $guilds, string $path[, array<int, string> $connectors = [] ]) : string
Parameters
$bridges : int
$guilds : int
$path : string
$connectors : array<int, string> = []

Which networks those bridges are spread across.

Return values
string

summarise()

One line per broken bridge, plus how many are healthy.

public static summarise(array<int, array{connector: string, channel_id: string, target: string, channel_ok: bool, target_ok: bool, joined: bool}> $rows) : array{healthy: int, problems: list}
Parameters
$rows : array<int, array{connector: string, channel_id: string, target: string, channel_ok: bool, target_ok: bool, joined: bool}>
Return values
array{healthy: int, problems: list}
On this page

Search results