Skip to content
GitHub

PresentedError

interface in meocord/interface Since 4.1.0

interface PresentedError

An error a presenter styles: the words a filter chose, and the error itself.

Members

message

message: string

What the user is told, fitted to Discord's limit for the answer's mode: at most 4096 characters for an embed and 4000 for a Components V2 Text Display, cut to end in …. An empty or whitespace-only message comes as MeoCord's generic error text. So a presenter that writes it as its view's text renders, whatever the error's message.

error

error: unknown

The error being answered, so a presenter can style it by kind.

tone

tone: 'warning' | 'danger'

Which theme colour suits the error: 'warning' for the user's own outcome, such as a cooldown, a refused guard or a UserError, and 'danger' for a fault in the bot. Read context.theme.colors[tone].