InstallCheck
in package
Reads the application's install settings back and says what is wrong with them, once, at startup.
Who can add the bot to a server is decided in the Developer Portal, not in this process — and it decides a great deal. Whoever can link a room in any server the bot is in can reach every Twitch channel and Telegram chat the bot can, so a bot anyone can add is a bot anyone can point at those rooms. The portal says nothing when it is left that way, so this does.
Pure: it takes the application as Discord returned it and hands back findings, so it can be tested without a connection.
Tags
Table of Contents
Constants
- INFO : mixed = 'info'
- WARNING : mixed = 'warning'
- USER_INSTALL : mixed = '1'
- Discord's installation-context key for a user install.
Methods
- review() : array<int, array{level: string, message: string}>
- allowsUserInstall() : bool
- info() : array{level: string, message: string}
- warning() : array{level: string, message: string}
- withoutQuery() : string|null
- `https://host/path`, or `null` when it is not an https URL.
Constants
INFO
public
mixed
INFO
= 'info'
WARNING
public
mixed
WARNING
= 'warning'
USER_INSTALL
Discord's installation-context key for a user install.
private
mixed
USER_INSTALL
= '1'
Methods
review()
public
static review(object $application) : array<int, array{level: string, message: string}>
Parameters
- $application : object
-
Discord's application object: a DiscordPHP
Applicationpart, or the raw payload.
Return values
array<int, array{level: string, message: string}>allowsUserInstall()
private
static allowsUserInstall(mixed $config) : bool
Parameters
- $config : mixed
Return values
boolinfo()
private
static info(string $message) : array{level: string, message: string}
Parameters
- $message : string
Return values
array{level: string, message: string}warning()
private
static warning(string $message) : array{level: string, message: string}
Parameters
- $message : string
Return values
array{level: string, message: string}withoutQuery()
`https://host/path`, or `null` when it is not an https URL.
private
static withoutQuery(string $url) : string|null
Parameters
- $url : string