TemplateMOTDPlugin replaces TShock's MOTD engine with Scriban
- Download the latest release
- Drag and drop the
.zip
file into the server root directory - Unzip the
.zip
- Optionally, make a copy of
tshock/motd.txt
then clear the original file's contents- If you skip the above step, then the plugin will automatically do it for you. A backup of the MOTD will be located at
config/templatemotd/motd.old.tshock.{timestamp}.txt
. The{timestamp}
is the UTC Unix timestamp of MOTD file's creation date
- If you skip the above step, then the plugin will automatically do it for you. A backup of the MOTD will be located at
- Done!
The MOTD can be viewed when joining and when running the command /motd
Run the command /reload
to reload the MOTD.
For performance reasons, the MOTD is cached in memory. Whereas TShock doesn't and reads it from the file when needed.
The templating engine is Scriban. For simplicity's sake, no Scriban usage will be detailed or supported here. Instead, refer to Scriban's documentation https://github.com/scriban/scriban#documentation.
Scriban changes names from OnlinePlayer
to online_player
to match Liquid templates.
https://github.com/scriban/scriban/blob/master/doc/runtime.md#member-renamer
Currently, there is only one model. It provides all variables available through TShock, but also a few more(feel free to create an issue to include more).
At the moment, these are the additionally exposed variables:
command_silent_specifier
the silent command specifier, by default.
.players_array
an array of TShock players.
- Restore tools:
dotnet tool restore
- Restore dependencies:
dotnet paket restore
- Build:
dotnet build