forked from BlackWolfWoof/yagpdb-cc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
new_account_warning.yag
27 lines (25 loc) · 1.69 KB
/
new_account_warning.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
{{/*
Trigger Type: Join Messsage (server)
Copyright (c): Black Wolf, 2021
License: MIT
Repository: https://github.com/BlackWolfWoof/yagpdb-cc/
*/}}
{{$roleid := 605874249084829719}}
{{/*This will be the role that gets pinged. MAKE SURE YOU CHANGE OUT THE ID WITH YOURS!*/}}
{{$age := 43829}}
{{/*Account age in minutes 43829 = one month*/}}
{{$channel := .Channel.ID}}
{{/*Channel to send message in. Use .Channel.ID for the current channel or replace with channel ID*/}}
{{if lt (currentUserAgeMinutes) $age}}
{{if not (dbGet .User.ID "warningcooldown")}}
{{$embed := sdict "author" (sdict "icon_url" (.User.AvatarURL "1024") "name" "New user with new account joined!") "fields" (cslice (sdict "name" "**• User:**" "value" (print .User.Mention " `" .User.String "`") "inline" true) (sdict "name" "**• ID:**" "value" (print .User.ID) "inline" true) (sdict "name" "**• Age:**" "value" (humanizeDurationSeconds (currentTime.Sub currentUserCreated)) "inline" true)) "footer" (sdict "text" (print .User.String " joined")) "timestamp" currentTime "color" 16426522}}
{{if lt (currentUserAgeMinutes) 1440}}
{{$embed.Set "fields" ($embed.fields.Append (sdict "name" "**• WARNING:**" "value" "This account is probably an alt or a spam / raid account‼" "inline" true))}}
{{$embed.Set "color" 15158332}}
{{sendMessageNoEscape $channel (complexMessage "embed" (cembed $embed) "content" (print "❗WARNING: User with extremely " (mentionRoleID $roleid) " joined!"))}}
{{else}}
{{sendMessageNoEscape $channel (complexMessage "embed" (cembed $embed) "content" (print "⚠️User with " (mentionRoleID $roleid) " joined!"))}}
{{end}}
{{dbSetExpire .User.ID "warningcooldown" true 86400}}
{{end}}
{{end}}