Modules1 min read
Notifications
Toasts labelled with your server name, updated in place by id.
notify:1Tier A · DecorateGood for
- Queue position that updates in place
- Match found, round starting, restart warnings
- Rewards and level-ups without spamming chat
Try it in game, no code
/tehoapi notify * &bRanked_queue Match found!A notification is a toast in Teho's own notification stack, labelled with your server's name and icon so it can never pass for a message from Teho itself. Re-sending the same id updates the toast in place, which makes it good for progress ("Queue: 3rd in line") as well as one-off messages.
Send one
teho.notify(Notification.builder("queue")
.title("Ranked queue")
.body("You are 3rd in line")
.accent(0x4DA9FF)
.duration(5000)
.sound(true)
.build());Later, update it with the same id, or take it down early:
teho.notify(Notification.builder("queue").title("Ranked queue").body("Match found!").accent(0x7CDB8A).build());
teho.dismiss("queue");Builder
| Method | Default | Notes |
|---|---|---|
builder(id) | required | Identifies the toast. Same id, same toast. |
title(String) | required | Up to 64 characters. § colour codes allowed. |
body(String) | empty | Up to 256 characters. |
accent(rgb) | Teho blue | The toast's accent stripe. |
duration(ms) | client default | Clamped to 1–15 seconds. |
sound(boolean) | false | Play the notification sound. |
What the player sees and controls
- At most 5 toasts per 10 seconds from your server. Extra ones are dropped.
- Text is plain text plus colour codes. Formatting that could imitate Teho's own chrome is stripped.
- Quiet mode in Settings -> Servers turns your notifications off while keeping every other feature.
No code
Turn on the welcome toast in config.yml, or test from the console:
welcome:
enabled: true
title: "&bWelcome, {player}"
body: "This server supports Teho"/tehoapi notify * Restart in 5 minutes Save your builds