-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathroundReport.ser
More file actions
28 lines (23 loc) · 951 Bytes
/
Copy pathroundReport.ser
File metadata and controls
28 lines (23 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Disabled by default: remove # from the filename to enable this script.
# Sends a small Discord report after each round.
# Create Custom Configs/round-report.yml inside the SER config directory:
# webhook_url: "https://discord.com/api/webhooks/..."
!-- OnEvent RoundEnded
-- require $evLeadingTeam
*settings = Config.Read "round-report"
if {*settings -> isInvalid}
Error "Round report was not sent. Create Custom Configs/round-report.yml and add webhook_url."
stop
end
$webhookUrl = Config.GetOption *settings "webhook_url" ""
if {$webhookUrl -> length} is 0
Error "Round report was not sent. Set webhook_url in Custom Configs/round-report.yml."
stop
end
$content = "Round ended. Leading team: {$evLeadingTeam}. Players online: {AmountOf @all}."
*message = Discord.CreateMessage $content
attempt
Discord.SendMessage $webhookUrl *message
on_error with $message
Error "Round report could not reach Discord: {$message}"
end