Repository navigation
Conversation
15dae73 to
d25a231
Compare
…e method in ModerationUtils;
|
| boolean isFirsttime = | ||
| actionsStore.getActionsByTargetAscending(guild.getIdLong(), target.getIdLong()) | ||
| .stream() | ||
| .noneMatch(action -> action.actionType() == ModerationAction.QUARANTINE); |
There was a problem hiding this comment.
Use findLastActionAgainstTargetByType and rename isFirsttime to isFirstTime
| boolean isFirsttime = | |
| actionsStore.getActionsByTargetAscending(guild.getIdLong(), target.getIdLong()) | |
| .stream() | |
| .noneMatch(action -> action.actionType() == ModerationAction.QUARANTINE); | |
| boolean isFirstTime = actionsStore | |
| .findLastActionAgainstTargetByType(guild.getIdLong(), target.getIdLong(), | |
| ModerationAction.QUARANTINE) | |
| .isEmpty(); |
| final String guildId = guild.getId(); | ||
| final String targetId = target.getId(); | ||
|
|
||
| if (!isFirsttime) { |
There was a problem hiding this comment.
| if (!isFirsttime) { | |
| if (!isFirstTime) { |
Corresponding to above
| Member member = Objects.requireNonNull(event.getMember()); | ||
|
|
||
| if (!Guilds.hasMemberRole(member, ModerationUtils.getIsQuarantinedRolePredicate(config))) { | ||
| event.reply("You are not quarantined anymore!").setEphemeral(true).queue(); |
There was a problem hiding this comment.
| event.reply("You are not quarantined anymore!").setEphemeral(true).queue(); | |
| event.reply("You are not quarantined anymore!").setEphemeral(true).queue(); |
| if (member == null) { | ||
| logger.warn(LogMarkers.SENSITIVE, | ||
| "scam message detected from a user that is not a member of the guild '{}'.", | ||
| guild.getId()); | ||
| return; | ||
| } |
There was a problem hiding this comment.
The only channels that are read are TextChannel's (a MessageChannel specifically for Guilds), that said if the user is not a Member of the guild we would have a shitton of NPE's before we arrive at this point. See ScamBlocker:142
|
could u please add to ur PR description a description of what u changed in the code and how. so we can better review it? like, which parts are new code, what has been moved from where to where? that kind of stuff |



When a user is quarantined, the bot posts a message in the
#quarantine-zonechannel that pings them and offers an "Unquarantine me" button. Users who regained control of their account can get back in without a mod.demo-qss.mp4