Betsy Bot Documentation
  • Betsy Bot Discord Bot
    • Betsy Premium Subscriptions
  • Global Commands
    • /user
    • /ticket
    • /payment
    • /giveaway
    • /channel
    • /ai
    • /review
    • /github
    • /key-value
  • Features
    • Settings
      • Auto Roles
      • Setting up your custom bot
      • Global command management
      • Update configuration owner
    • Support Panels (Tickets)
      • Create Support Panel
      • Edit Support Panel
      • Delete a Support Panel
      • Copy a Support Panel
      • Custom Implementations
    • Giveaways
      • Create giveaways
      • Edit giveaways
      • Delete giveaways
    • Polls
      • Create a poll
      • Edit a poll
      • Delete poll
    • Thread Channels
      • Create Thread Channels
      • Edit Threads Channel
      • Delete Thread Channels
      • Disable a Thread Channel
    • Send Message / Announcement
      • Create Message/Announcement
    • Tracked messages
      • Create Tracked Messages
      • Edit Tracked Messages
      • Copy Tracked Messages
      • Delete Tracked Messages
    • Sticky Messages
    • Welcome Messages
      • Create Welcome Messages
      • Edit Welcome Messages
      • Delete Welcome Messages
    • Auto Responders
      • Create Auto Responders
      • Edit Auto Responders
      • Delete Auto Responders
    • Custom commands
      • Create custom commands
      • Edit custom commands
      • Delete custom commands
    • Invite Tracker
    • Payments
    • Action Logs
    • Invite Link Blocker
    • Role Selection
    • Channel Cleaners
      • Create channel cleaners
      • Delete configuration of a cleaning channel
      • Update channel cleaning
    • User Verification
    • Reviews
    • Twitch Event Subscriptions
    • Channel Backups
  • Configurable Commands
    • Response Commands
    • Data Commands
      • Forms
      • REST Commands
  • Extras
    • Server Resources
      • Message Templates
      • Forms
      • Key Value Storage
    • Message Templating Engine
      • Message FAQs
    • Custom ID Actions
    • Betsy REST API
      • Webhooks
    • Betsy Webhook Messages
    • Github Integration
Powered by GitBook
On this page
  • How does it work?
  • How to use it?
  • Available Templating Functions
  • time
  • keyValue
  • keyValueCategory
  • ticketUser
  • ticketChannel

Was this helpful?

  1. Extras

Message Templating Engine

A powerful and useful templating engine to have more control over the messages you are sending with Betsy

PreviousKey Value StorageNextMessage FAQs

Last updated 1 year ago

Was this helpful?

How does it work?

Anytime you send a message through Betsy the message will be interpreted by our templating engine which will format the message before it is sent to discord. Allowing you to do various things like inserting a time, date, parameter, and so much more.

How to use it?

In order to tell the templating engine that you have something in your message that needs to be formatted you must include a template instruction, OR an empty template instruction (${}) inside the CONTENT of a message. Empty template instructions are replaced with an empty string so they are not sent in the final message.

Simply include our templating tag anywhere into the discord message and watch the magic happen. For example lets say you want to have a formatted date time that is 3600 seconds (1 hour) in the future. Anywhere in your message simply add <t:${time:3600}> to show a formatted date in the future.

This example will make use of the Discord Date Time Formatting Feature

The templating engine being used in the message builder.

Available Templating Functions

time

This will generate the current epoch time, and accepts a parameter which is how many seconds in the future you want to add.

Example ${time:0} - The current time

Example ${time:60} - One minute in the future

Parameter
Description

seconds

The number of seconds to add to the current time. For example ${time:3600} will add one hour to the current time at which the message was sent

keyValue

This will pull a stored value into the message template.

Example: ${keyValue:testCategory:testKey} In the below image example this will fill in "Some Awesome Value" into that space.

Parameter
Description

category

The category identifier that you have set in the panel

key

The matching key value for the stored item inside of the given category

keyValueCategory

This will pull a stored value into the message template.

Example: ${keyValueCategory:testCategory} In the above image example this will fill in "Some Awesome Value" into that space.

NOTE: If Mark Used On Fetch is turned on it will grab the next UNUSED key value pair.

ticketUser

When the message is sent within a ticket channel this will replace the templating engine instruction with a mention to the user.

Example: ${ticketUser}

ticketChannel

Can only be used in the Interaction Response for a Ticket Channel. Used to provide a link to the channel that is created for the ticket interaction response.

Example: ${ticketChannel}

The formatted message in Discord
An example of the matching category parameter
An example of the matching key parameter
https://c.r74n.com/discord/formatting#Timestamps