Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into enhance/database-reset
Browse files Browse the repository at this point in the history
  • Loading branch information
galen8183 committed May 17, 2022
2 parents a00dd9c + 9890313 commit e802a00
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Auto_Moderation/Anti_Raid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ If you are not sure if you have set it up correctly or have any questions you ca
### Important

**You have to tweak the values to your serversize.
Pleace decide that on your own, as I cannot guess how many people join how fast normally on your server.
Please decide that on your own, as I cannot guess how many people join how fast normally on your server.
The default value of 5 people within 60 seconds might be good for small servers, but for big servers a lower seconds value is probably needed.
Even for large servers I do not reccomend setting the `$people` higher than `5`. I'd only change the `$seconds` or lower the `$people` variable.**
Even for large servers I do not recommend setting the `$people` higher than `5`. I'd only change the `$seconds` or lower the `$people` variable.**
1 change: 1 addition & 0 deletions Database_Management/reset/dbresetkey.yag
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Permissions available: Administrator, ManageServer, ReadMessages, SendMessages,
{{if eq $count 100}}
{{editMessage nil $data.MsgID (cembed "description" (printf "<a:load:714051544265392229> Deleting DB entries... `%d/%d`\nEstimated end time: <t:%d:T> (<t:%[3]d:R>)\nDon't run `dbresetkey` before the end time!\nYou will be pinged when the entries are cleared :)" $data.Count $data.Initial (or (and $.IsPremium 10) 2|mult 100|fdiv (sub $data.Initial $data.Count)|mult 8.0|add 8 currentTime.Unix)) "color" 0xFAA61A)}}
{{execCC .CCID nil 8 $data}}

{{else}}
{{deleteMessage nil $data.MsgID 0}}
{{sendMessage nil (complexMessage "content" .User.Mention "embed" (cembed
Expand Down
47 changes: 24 additions & 23 deletions Misc/image_reaction.yag
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Note: Please configure the variables after pasting the code into your control panel and also make sure to limit this to a channel if needed!

Copyright (c): Black Wolf, 2021
Copyright (c): Black Wolf, 2022
License: MIT
Repository: https://github.com/BlackWolfWoof/yagpdb-cc/
*/}}
Expand All @@ -19,43 +19,44 @@



{{$woulddelete1 := false}}{{$woulddelete2 := false}}{{$woulddelete3 := false}}
{{/*Don't touch variables below*/}}
{{$woulddelete := false}}{{$skip := false}}

{{/*Attachment Media*/}}
{{range .Message.Attachments}}
{{if not (reFind `(?i)\.(?:jpg|jpeg|png|gif|tif|webp|mp4|webm|mov)` .Filename)}}
{{$woulddelete1 = true}}
{{end}}
{{else}}
{{$woulddelete1 = true}}
{{end}}

{{/*Media Link*/}}
{{range (reFindAll `https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)` .Message.Content)}}
{{range (reFindAll `(?i)https?:(?://([^/?#]*))?(?:[^?\n#\s]*?/[^?\n#\s]+\.(jpg|jpeg|png|gif|tif|webp|mp4|webm|mov))(?:\?([^?\n#\s]*))?(?:#(.*))?` .)}}
{{if (reFind `(?i)\.(jpg|jpeg|png|gif|tif|webp|mp4|webm|mov)\z` .Filename)}}
{{$skip = true}}
{{else}}
{{$woulddelete2 = true}}
{{$woulddelete = true}}
{{end}}
{{else}}
{{$woulddelete2 = true}}
{{$woulddelete = true}}
{{end}}

{{/*Embed Media*/}}
{{range (seq 1 6)}}{{if not $.Message.Embeds}}{{sleep 1}}{{end}}{{end}}
{{range .Message.Embeds}}
{{if eq .Type "video" "image" "gifv"}}
{{if not $skip}}
{{$emb := .Message.Embeds}}{{$tmp := true}}
{{range (seq 0 2)}}{{if not ($emb = (getMessage nil $.Message.ID).Embeds)}}{{sleep 1}}{{end}}{{end}}
{{range $emb}}
{{if .Thumbnail}}
{{$tmp = false}}
{{end}}
{{end}}
{{if $tmp}}
{{$woulddelete = true}}
{{else}}
{{$woulddelete3 = true}}
{{$woulddelete = false}}
{{end}}
{{else}}
{{$woulddelete3 = true}}
{{end}}

{{/*Delete Message*/}}
{{if and $delete $woulddelete1 $woulddelete2 $woulddelete3}}
{{deleteTrigger 0}}
{{if $delete}}
{{if $woulddelete}}
{{deleteTrigger 0}}
{{end}}
{{end}}

{{/*Add Reactions*/}}
{{if and (or (not $woulddelete1) (not $woulddelete2) (not $woulddelete3)) $react}}
{{if and (not $woulddelete) $react}}
{{range $emojis}}{{addReactions .}}{{end}}
{{end}}

0 comments on commit e802a00

Please # to comment.