Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Seniors and Staff Exempt from Anti-Raid - #1

Merged
lostdesign merged 12 commits into
devcord:masterfrom
austinmccalley:master
Apr 17, 2020
Merged

Seniors and Staff Exempt from Anti-Raid#1
lostdesign merged 12 commits into
devcord:masterfrom
austinmccalley:master

Conversation

@austinmccalley

Copy link
Copy Markdown
Member

Staff and seniors are now exempt from anti-raid

Austin Mand others added 6 commits April 16, 2020 12:22
Getting senior and staff role from config
Senior now bypasses anti-raid
Senior's now bypass anti-raid features. Pls dont abuse
Staff and seniors are now exempt from the anti raid, added some notes as well on what needs to be done with the continuation of it. Need to add a message to send to #mod-log, yet it has not been implemented

@austinmccalleyaustinmccalley left a comment

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic is weird for checking if not senior or not staff. If we check both at the same time and a staff isn't a senior they get bonked. Due to false || true with the statement !staff || !senior. I am probably being dumb and can't figure it out.

@redxtech

Copy link
Copy Markdown

Try using .some on an array of .staff & senior.

['staff', 'senior'].some(r => user.roles.includes(r))

Not valid code but got the right idea.

@lostdesignlostdesign left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! See comment.

Comment threadsrc/processes/antiraidListener.ts Outdated
Comment threadsrc/processes/antiraidListener.ts Outdated
Comment threadsrc/processes/antiraidListener.ts Outdated
Comment threadsrc/processes/antiraidListener.ts Outdated
Comment threadsrc/processes/antiraidListener.ts Outdated
Thanks to wafflen for the suggestions on the logic and var names
Forgot to switch branches
Reset time on new spam message, as well config defines the max amount of mentioned roles and members
Comment threadconfig.example.ts Outdated
Comment threadsrc/processes/antiraidListener.ts Outdated
Comment threadsrc/processes/antiraidListener.ts Outdated
Comment threadsrc/processes/antiraidListener.ts
austinmccalleyand others added 2 commits April 17, 2020 12:08
Co-Authored-By: wellá <info@lost.design>
Co-Authored-By: wellá <info@lost.design>
Comment threadsrc/processes/antiraidListener.ts Outdated
Removed old comment
@lostdesign
lostdesign merged commit 6a7a55f into devcord:masterApr 17, 2020

if (isStaff || isSenior) {
return
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No else! return -> end of function

mentionedUsers > maxMentionedMemebers ||
mentionedUsers + mentionedRoles > maxMentionedEverything
) {
lastKnownTimestamp

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specific comparison like === null

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@austinmccalley@redxtech@lostdesign@FunctionDJ