-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost-remove.yag
84 lines (70 loc) · 3.21 KB
/
host-remove.yag
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{{/*
Shiny/Hundo/Shundo Host Leaderboard
Trigger: host-remove
Trigger Type: Command (mention/cmd prefix)
Require Roles: Bot, RR Mod, RR Leader
decreases total by username
!host-remove <type> <@username or userID>
1st argument: hundo/shiny/shundo
2nd argument: username/userID
Settings: limit to channels where you want access to edits
*/}}
{{/* Set up thumbnail images for confirmation messages*/}}
{{ $hundoThumbnail := "https://cdn.discordapp.com/emojis/749800513297449021.png?v=1" }}
{{ $shinyThumbnail := "https://cdn.discordapp.com/emojis/747623016829157461.gif?v=1" }}
{{ $shundoThumbnail := "https://cdn.discordapp.com/emojis/883800023689732116.gif?v=1" }}
{{ $errorThumbnail := "https://cdn.discordapp.com/emojis/642444935093813268.png?v=1" }}
{{/* ------------ DO NOT ALTER CODE BELOW ------------ */}}
{{/* Parsing and checking command arguments */}}
{{$args := parseArgs 2 "Syntax is *<hundo, shiny, shundo> <@user/userID>*"
(carg "string" "choose from hundo, shiny or shundo")
(carg "userid" "user who hosted raid")}}
{{/* Setting up variables from command arguments */}}
{{ $type := lower ($args.Get 0)}} {{/* Convert first argument to lower case and set variable*/}}
{{ $userID := ($args.Get 1)}} {{/* set 2nd argument as user variable */}}
{{ $user := (userArg $userID)}}
{{ $mention := $user.Mention}} {{/* Make user into mention */}}
{{/* Checking $type variable for correct command */}}
{{ if eq $type "hundo"}}
{{addReactions ":hostCheck:896481862455812157"}}
{{$v := dbIncr $userID $type -1}} {{/* increments data element by 1*/}}
{{$hundoCount := ((dbGet $userID "hundo").Value)}}
{{ $embed := cembed
"title" "Hundo Count Adjusted"
"description" (println "The Hundo count for" $mention "has been adjusted.\n Total Hundos hosted to date is now" $hundoCount)
"thumbnail" (sdict "url" $hundoThumbnail )
"color" 4645612
}}
{{ sendMessage nil $embed }}
{{ else if eq $type "shiny"}}
{{addReactions ":hostCheck:896481862455812157"}}
{{$v := dbIncr $userID $type -1}} {{/* decreases data element by 1*/}}
{{$shinyCount := ((dbGet $userID "shiny").Value)}}
{{ $embed := cembed
"title" "Shiny Count Adjusted"
"description" (println "The Shiny count for" $mention "has been adjusted.\n Total Shinies hosted to date is now" $shinyCount)
"thumbnail" (sdict "url" $shinyThumbnail )
"color" 4645612
}}
{{ sendMessage nil $embed }}
{{ else if eq $type "shundo"}}
{{addReactions ":hostCheck:896481862455812157"}}
{{$v := dbIncr $userID $type -1}} {{/* decreases data element by 1*/}}
{{$shundoCount := ((dbGet $userID "shundo").Value)}}
{{ $embed := cembed
"title" "Shundo Count Adjusted"
"description" (println "The Shundo count for" $mention "has been adjusted.\n Total Shundos hosted to date is now" $shundoCount)
"thumbnail" (sdict "url" $shundoThumbnail )
"color" 4645612
}}
{{ sendMessage nil $embed }}
{{ else }}
{{addReactions "❌"}}
{{ $embed := cembed
"title" "Error Detected: invalid option."
"description" "The options are: \n- hundo \n- shiny \n- shundo"
"thumbnail" (sdict "url" $errorThumbnail )
"color" 4645612
}}
{{ sendMessage nil $embed }}
{{end}}