NotificationText.h header

#include <ew/app/NotificationText.h>

Namespace ew::app

Functions

QString ew::app::webhook::describeDiceRoll(const QString &notation, const ew::app::ttrpg::DiceRollResult &result)

The message a dice roll becomes when it is posted to a channel.

Written for somebody who did not press the button. The party reading the channel sees only this line, so it has to carry what was rolled as well as what came up – "17" tells them nothing, and "1d20+2: 15 +2 = 17" tells them whether to believe it. That is the whole difference between a notification and a number.

The individual dice are shown because a keep-highest roll is not reconstructible from the total, and because seeing the dice is most of the pleasure of rolling them in company.

Returns an empty string for an invalid roll: there is nothing truthful to say about a roll that did not happen, and posting "invalid" to somebody's party channel is worse than silence.