Content Manager Description Templates - JustaPenguin/assetto-server-manager GitHub Wiki
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 any 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!
In v2.1.4 and onwards you can access elements inside SessionResults if the Results boolean is true.
If you have modified the Discord Notification Message prior to updating to v2.1.4 then the default results section of the template will not be shown, so you can also find it here:
{{ if .Results }}
{{ with .BaseURL }}[{{ $.SessionResults.Type.String }} Results]({{ . }}results/{{ $.SessionResults.SessionFile }})
{{ else }}{{ range $i, $result := .SessionResults.Result }}{{ add 1 $i }}{{ ordinal (add 1 $i) }}: {{ $result.DriverName }}{{ end }}
{{ end }}
{{ end }}