Skip to content

Canned Responses

blank_dvth edited this page May 11, 2023 · 7 revisions

Canned Responses are used in post boxes on all threads, to allow you to automatically fill in various saved content.


Adding Canned Responses

This guide will detail how to add your own canned responses through the Forum Enhancement Script.

All canned responses use the following format in the config:

===
- Name
- Category
Content
===

Name is the name of the canned response that will be shown in the interface. Category is the name of the dropdown the canned response will be filed under (alongside all other responses with the same category). Finally, content is where your actual content will be.

Categories will be shown left to right in the order they are configured, as well as individual canned responses, which show top to bottom in their respective categories in the order they are configured.

=== is used as a separator for configs, they are needed at the very bottom of configs, however only needs to be put at the top once (for the first config), otherwise they can be omitted. Ensure that === is not used in your content at the start of a line (it is okay to put this in the middle, or after a space at the start of the line).

For example, if I wanted to have two templates to greet people:

===
- Say Hello
- Greetings
Hello there!
===
- Say Good Morning
- Greetings
Good morning!
===

(note: having two separators on separate lines in the middle is accepted as well)

Placeholders

Using Placeholders

Placeholders can be used in your canned response text by placing the name of a placeholder in triple curved brackets. For example, {{{username}}} would be replaced with your own username. Make sure there are no extra spaces. You are free to use curly braces in your text so long as they don't exactly match an existing placeholder (if it does, just add a zero width space or something similar).

Revisiting the example config above, we can make it a bit more customized now:

===
- Say Hello
- Greetings
Hello there, @{{{op username}}}!
===
- Say Good Morning
- Greetings
Good morning @{{{op username}}}!
===

Available Placeholders

  • username: your own username
  • op username: username of the poster of the thread

Have a placeholder you want to suggest? Open an issue!
I am considering adding some form of basic data modification (trim, regex matches, basic logic, etc) to placeholders, although that's likely to be in the distance future.

Clone this wiki locally