Skip to main content
Fyre’s templating is based on Handlebars. Visit their website to learn more advanced logic and syntax.

Basic Syntax

Handlebars has a simple to use syntax for inserting variables into text. Templating is built with Fyre’s Variables in mind to give you the best experience. You can use all Discord Markdown in your templates, Handlebars just adds additional syntax for variables. To insert a variable, surround it in triple braces/curly brackets. We use triple braces because they don’t do HTML Escaping. If your variable won’t return any special characters (& \ " ' = <>) you can use double braces instead of triple braces.
Welcome {{{user.mention}}} to {{{guild.name}}}!
Welcome @Fallen to Fyre Support!

Basic Logic

Handlebars offers a few helpers to work with optional variables or do simple logic checks.

If / If Else

To check if an optional variable exists, or if a boolean variable is true, use #if. You don’t need to have an {{else}} statement if you don’t need one, but it’s provided in this example anyway.
{{#if track.nowPlaying}}
Track is Now Playing
{{else}}
Track isn't Playing
{{/if}}

Track Name: {{{track.name}}}
Track is Now Playing

Track Name: The Outfield
Track isn't Playing

Track Name: The Outfield

Unless

Unless is the opposite of if. Use it to check if a variable doesn’t exist, or if a boolean value is false, use #unless.
{{#unless track.loved}}
Track isn't Loved!\n
{{/unless}}
Track Name: The Outfield
Track Name: The Outfield
Track isn't Loved!

Track Name: The Outfield

Custom Helpers

Fyre has some custom helpers to add additional functionality to Handlebars.

Random

You can use the random helper to randomly select one of the provided strings or numbers. This helper should technically support infinite arguments, but it’s only been tested up to 10.
{{random "Example" "Of" "Random" "Strings"}}
Random
Example

Format Number

You can use the formatNumber helper to format long numbers with commas or periods. This helper supports using an IETF Language Tag for regional formatting (eg. “en-US” or “en-DK”).
Track Name: {{{track.name}}}
Total Plays: {{formatNumber track.totalPlayCount}}
Total Plays (en-DK): {{formatNumber track.totalPlayCount "en-DK"}}
Track Name: The Outfield
Total Plays: 28,200
Total Plays (en-DK): 28.200

Format Date & Time

You can use the formatDate helper to format a timestamp into any date format. This helper works with both Dayjs and Dayjs Advanced formatting options.
{{formatDate 946713600 "DD/MM/YYYY HH:mm"}}
01/01/2000 00:00

Format List

You can use the formatList helper to join an array of items into a string.
{{formatList afk.mentionLinks ", "}}
https://discord.com/channels/1370922624397606952/1374080670304833547/1496128374199025674, https://discord.com/channels/1370922624397606952/1374080670304833547/1480784410482708731, https://discord.com/channels/1370922624397606952/1374080670304833547/1466002583016706193

Capital Case

Capitalize the first letter of every word in a sentence.
{{capitalCase "Hello, this is a test!"}}
Hello, This Is A Test!