Results of last race in Discordbot?

Hey all i got a discordbot linked to our server, it spits all kinds of info when a race starts, when a race is ended etc. it works flawless.

i read in the wiki that the discordbot is able to access other data such as race results.
i want to implement that. when a race is over, post the results of the last race in our discord channel.

does anyone know where to change that setting?

Hi,

It’s only currently possible to post results for Championship sessions, but these would be the steps:

  1. On the Server Options page make sure that Championship Session Complete is selected as a Notify On option.
  2. Go to the Server → Messages page, here you can configure the Discord notification message, here is an example that you could add to show basic results information:
{{ if .Results }}
{{ with .BaseURL }}[{{ $.SessionResults.Type.String }} Results]({{ . }}results/{{ $.SessionResults.SessionFile }})

{{ range $i, $result := .SessionResults.Result }}{{ add 1 $i }}{{ ordinal (add 1 $i) }}: {{ $result.DriverName }}
{{ end }}
{{ end }}

And a much more complex example (including info for non-results data) from one of our users on Discord (link to original post):

{{if .ChampionshipName}}**{{.ChampionshipName}}**: {{end}}**{{.EventName}}** - an event hosted by **{{ .ServerName }}**
{{ if .Results }}
  **__{{$.SessionResults.Type.String}} Results__**:
  {{ with .BaseURL }}[{{ $.SessionResults.Type.String }} Results]({{ . }}/results/{{ $.SessionResults.SessionFile }}){{ end }}
  {{ range $i, $result := $.SessionResults.Result }} {{if gt $result.TotalTime 0}}
**{{ add 1 $i }}{{ ordinal (add 1 $i) }}: {{ $result.DriverName }}** - {{prettify $result.CarModel true}}  {{if  eq (add 1 $i) 1}}:first_place:{{end}} {{if  eq (add 1 $i) 2}}:second_place:{{end}} {{if  eq (add 1 $i) 3}}:third_place:{{end}} 
> FL: {{ $millis := mod $result.BestLap 1000}}{{ $remainingSeconds := div $result.BestLap 1000 }}{{ $minutes := div $remainingSeconds 60 }}{{ $seconds := mod $remainingSeconds 60}}{{$minutes}}:{{printf "%02d" $seconds}}.{{ printf "%03d" $millis }} ({{$result.BestLapTyre $.SessionResults}}) {{if $.SessionResults.IsFastestLap $result.BestLap 0}}:stopwatch:{{end}} {{if eq $.SessionResults.Type.String "Race" }}
> C: {{$.SessionResults.GetConsistency  $result.DriverGUID $result.CarModel}}%% {{end}}
> BoP: {{$result.Restrictor}}%% + {{$result.BallastKG}}Kg
{{end}} {{ end }}
{{ else }}
{{ if .Scheduled }}
  Scheduled Date: {{ .ScheduledDate }}
{{ end }}
{{ with .Password }}
  **Password:** ||{{ . }}||
{{ else }}
  No password
{{ end }}
**Track:** {{ .TrackInfo }}
**Car(s):** {{ .CarList }}
{{ end }}

This longer example generates a post like this for results:

image

Thanks!