-
Notifications
You must be signed in to change notification settings - Fork 66
/
avatar.yag
32 lines (26 loc) · 911 Bytes
/
avatar.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
{{/*
Trigger: avatar
Trigger Type: Command
Usage:
avatar
avatar @member
Made by @blackwolfwoof
*/}}
{{$prefix := index (reFindAllSubmatches `Prefix of \x60\d+\x60: \x60(.+)\x60` (exec "prefix")) 0 1}}
{{$args := parseArgs 0 (print .Cmd " <Mention/ID (optional)>")
(carg "member" "ID")}}
{{$member := .Member}}
{{with ($args.Get 0)}}
{{$member = $args.Get 0}}
{{end}}
{{$embed := sdict
"author" (sdict "name" $member.User.String)
"description" (print "[User Avatar](" ($member.User.AvatarURL "4096") ")")
"image" (sdict "url" ($member.User.AvatarURL "4096"))}}
{{if $member.Avatar}}
{{$embed = sdict
"author" (sdict "name" $member.User.String "icon_url" ($member.User.AvatarURL "4096") "url" ($member.User.AvatarURL "4096"))
"description" (print "[Server Avatar](" ($member.AvatarURL "4096") ")")
"image" (sdict "url" ($member.AvatarURL "4096"))}}
{{end}}
{{sendMessage nil (cembed $embed)}}