Skip to content

Content Manager Description Templates

Henry Spencer edited this page Jul 20, 2021 · 5 revisions

Content Manager description templates make use of golang's templating language.

Default

{{ .Track }} {{ with .TrackLayout }}({{ . }}){{ end }} - an event hosted by {{ .ServerName }}

{{ .EventDescription }}
{{ .ChampionshipPoints }}
{{ .CarDownloads }}
{{ .TrackDownload }}

Advanced

You can use any of the elements inside the CurrentRaceConfig struct and the GlobalServerConfig struct (click the links for details).

On top of this you can use the custom template variables ({{ .EventDescription }}, {{ .ChampionshipPoints }}, {{ .CarDownloads }}, {{ .TrackDownload }} shown in the example above.

For example:

{{ .Track }} {{ with .TrackLayout }}({{ . }}){{ end }} - an event hosted by {{ .ServerName }}

Would show the following for an event at laguna seca:

ks_laguna_seca - an event hosted by Assetto Server Manager

Another example is:

{{ .ServerName }} - {{ .EventName }} {{ if eq .RaceExtraLap 1 }}This server will force you to drive another lap at the end of the race!{{ end }} 

Discord Notifications

Discord Notification Templates also have access to anye elements inside the CurrentRaceConfig struct and the GlobalServerConfig struct (click the links for details). They also have access to the following custom variables:

  • ServerName
  • EventName
  • NotificationContext (for example Started, Scheduled)
  • Started, PracticeStarted, Scheduled, Unscheduled, Reminder (booleans linked to the Context)
  • ScheduledDate (as a string)
  • ReminderTime (as a string)
  • CarList

All of these variables are used in the default templates so you can see how they work!