Show Notification

Show a notification to the player

Description

'show notification <notification_id> [time]'

The notification action shows a system notification to the player. Notifications are useful for achievement unlocks, event alerts, or other non-intrusive messages.

Action ID: Notification

Reversible: Yes

Requires User Interaction: If no time is provided, the player must dismiss the notification, but the game continues without waiting.

Parameters

Name
Type
Description

notification_id

string

The ID of the notification to show (must be declared beforehand)

time

number

Optional. Time in milliseconds before auto-dismiss

Configuration

Declare notifications with their properties before using them:

monogatari.action('Notification').notifications({
    '<notification_id>': {
        title: '',
        body: '',
        icon: ''
    }
});

Properties

Name
Type
Description

title

string

The notification title (required)

body

string

The notification body text

icon

string

Path to an image for the notification icon

Browser Permissions

[!NOTE] Notifications use the browser's native Notification API. The player must grant permission when prompted. If denied, notifications won't be shown but the game continues normally.

Examples

Simple Notification

A notification the player dismisses manually:

Configuration:

Script:

Timed Notification

A notification that auto-dismisses after 5 seconds (5000ms):

Configuration:

Script:

Multiple Notifications

Configuration:

Script:

Using Variable Interpolation

Notification text supports storage variable interpolation:

Configuration:

Behavior Notes

  • The game does not wait for notifications to be dismissed

  • If permission is denied, no error is thrown—the game continues

  • Notification appearance depends on the browser and OS

  • Icons should be appropriate size (usually 64x64 or 128x128 pixels)

Error Handling

The action will show an error if:

  • The notification ID doesn't exist in the configuration

  • The time parameter is not a valid number

Last updated

Was this helpful?