DiscordPHP-BridgeBot Documentation

Config
in package

FinalYes

What the bot itself needs to start, as opposed to what any one connector needs.

Deliberately short. A connector reads its own settings out of the same Environment, so adding a network does not mean adding fields here — which is what would otherwise make the core grow a little every time a package it has never heard of is installed.

Tags
author

Valithor Obsidion valithor@discordphp.org

Table of Contents

Constants

DEFAULT_PREFIX  : mixed = '!'
What the bot answers to on Discord when no prefix is configured.
DEFAULT_WEBHOOK_NAME  : mixed = 'Bridge'
The name the relay's webhooks are created under.

Properties

$discordOwnerId  : string|null
$discordPrefix  : string
$discordToken  : string
$environment  : Environment
$logLevel  : string
$storePath  : string
$webhookName  : string

Methods

fromEnvironment()  : self
hasOwner()  : bool
Whether anyone at all can run operator-gated commands, and whether there is anybody to tell when a bridge breaks.
__construct()  : mixed

Constants

DEFAULT_PREFIX

What the bot answers to on Discord when no prefix is configured.

public mixed DEFAULT_PREFIX = '!'

DEFAULT_WEBHOOK_NAME

The name the relay's webhooks are created under.

public mixed DEFAULT_WEBHOOK_NAME = 'Bridge'

Properties

$discordOwnerId read-only

public string|null $discordOwnerId

$discordPrefix read-only

public string $discordPrefix

$discordToken read-only

public string $discordToken

$logLevel read-only

public string $logLevel

$storePath read-only

public string $storePath

$webhookName read-only

public string $webhookName

Methods

fromEnvironment()

public static fromEnvironment(Environment $environment, string $storePath) : self
Parameters
$environment : Environment
$storePath : string
Tags
throws
RuntimeException

when a required value is missing.

Return values
self

hasOwner()

Whether anyone at all can run operator-gated commands, and whether there is anybody to tell when a bridge breaks.

public hasOwner() : bool

Optional, and unset is the intended default: a bot that can reach any endpoint should require someone to have said who is allowed to do that.

Return values
bool

__construct()

private __construct(string $discordToken, string $discordPrefix, string|null $discordOwnerId, string $storePath, string $logLevel, string $webhookName, Environment $environment) : mixed
Parameters
$discordToken : string
$discordPrefix : string
$discordOwnerId : string|null
$storePath : string
$logLevel : string
$webhookName : string
$environment : Environment
On this page

Search results