-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathcommand.yag
53 lines (50 loc) · 1.75 KB
/
command.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
{{/*
Trigger: mod
Trigger Type: Command
Usage:
mod @user
Copyright (c): Black Wolf, 2021
License: MIT
Repository: https://github.com/BlackWolfWoof/yagpdb-cc/
*/}}
{{$prefix := index (reFindAllSubmatches `Prefix of \x60\d+\x60: \x60(.+)\x60` (exec "prefix")) 0 1}}
{{$args := parseArgs 1 (print $prefix "mod <UserID/Mention>") (carg "userid" "User")}}
{{if reFind `\d+` .StrippedMsg}}
{{$user := userArg ($args.Get 0)}}
{{$userid := $args.Get 0}}
{{$users := "Unknown User"}}
{{$usera := "https://cdn.discordapp.com/emojis/565142262401728512.png"}}
{{if (userArg (index .CmdArgs 0))}}
{{$userid = $user.ID}}
{{$users = $user.String}}
{{$usera = $user.AvatarURL "1024"}}
{{end}}
{{$x := sendMessageRetID nil (cembed
"author" (sdict
"name" (print $users " - Mod Panel")
"icon_url" $usera)
"description" "<a:bongoban:636572687124398081> - Ban, 👢 - Kick, <:servermute:711553322225500201> - Mute, 🔊 - Unmute, ❌ - Close Menu")}}
{{/*Permission Check*/}}
{{$var1 := split (index (split (exec "viewperms") "\n") 2) ", "}}
{{/*Ban*/}}
{{if (in $var1 "BanMembers")}}
{{addMessageReactions nil $x "a:bongoban:636572687124398081"}}
{{end}}
{{/*Kick*/}}
{{if (in $var1 "KickMembers")}}
{{if $user}}
{{addMessageReactions nil $x "👢"}}
{{end}}
{{end}}
{{/*Mute*/}}
{{if (in $var1 "ManageRoles")}}
{{if $user}}
{{addMessageReactions nil $x "servermute:711553322225500201" "🔊"}}
{{end}}
{{end}}
{{addMessageReactions nil $x "❌"}}
{{$v1 := dbSetExpire .User.ID (print .CCID "-" (randInt 10000) "del_message") (print "del" $x "-" .Message.ID) 300}}
{{$v2 := dbSetExpire .User.ID "mod_rq_message" (print "mod" $x "-" $userid) 300}}
{{deleteMessage nil $x 300}}
{{deleteTrigger 300}}
{{else}}This ID is invalid and doesn't exist!{{end}}