HelperTrait
Small presentation helpers shared by {@see NHA} and {@see Commands} for turning NHA world data into Discord output: a mention-safe {@see MessageBuilder} factory, a text progress-bar renderer and the project attribution footer.
Pure formatting only — no NHA API or world-model concerns live here.
Tags
Table of Contents
Constants
- GITHUB : mixed = 'https://github.com/discord-php/DiscordPHP-NHA'
- The project source repository.
- SPONSOR : mixed = 'https://github.com/sponsors/valzargaming'
- GitHub Sponsors page for the maintainer.
Methods
- attributionComponents() : TextDisplay}
- A {@see Separator} plus a subtle one-line footer crediting the project and pointing at the repo and GitHub Sponsors. Appended to the rich panels (observation, help, control panel) — not the one-line replies.
- bar() : string
- Renders a 0-1 ratio as a small text progress bar, e.g. for HP.
- createBuilder() : MessageBuilder
- Creates a new instance of MessageBuilder, optionally preventing mentions in the message.
Constants
GITHUB
The project source repository.
public
mixed
GITHUB
= 'https://github.com/discord-php/DiscordPHP-NHA'
SPONSOR
GitHub Sponsors page for the maintainer.
public
mixed
SPONSOR
= 'https://github.com/sponsors/valzargaming'
Methods
attributionComponents()
A {@see Separator} plus a subtle one-line footer crediting the project and pointing at the repo and GitHub Sponsors. Appended to the rich panels (observation, help, control panel) — not the one-line replies.
public
static attributionComponents() : TextDisplay}
Return values
TextDisplay}bar()
Renders a 0-1 ratio as a small text progress bar, e.g. for HP.
public
static bar(float $current, float $max[, int $length = 10 ]) : string
Parameters
- $current : float
- $max : float
- $length : int = 10
Return values
stringcreateBuilder()
Creates a new instance of MessageBuilder, optionally preventing mentions in the message.
public
static createBuilder([bool $prevent_mentions = true ]) : MessageBuilder
Parameters
- $prevent_mentions : bool = true