Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
| badpfp | (cancel), LowerMemberArg | Notifies the user that they should change their profile pic and applies a 30 minute mute. Bans the user if they don't change picture. |
| cleanse | LowerMemberArg | Use this to delete (permanently) as user's infractions. |
| removeInfraction | LowerMemberArg, Infraction ID | Use this to delete (permanently) an infraction from a user. |
| strike, s | LowerMemberArg, (Weight), Reason | Strike a user. |
| warn, w | LowerMemberArg, Reason | Warn a user. |
| strike, s, S | LowerMemberArg, (Weight), Reason | Strike a user. |
| warn, w, W | LowerMemberArg, Reason | Warn a user. |

## Mute
| Commands | Arguments | Description |
Expand All @@ -51,15 +51,15 @@
| rules | (Message) | List the rules of this guild. Pass a message ID to edit existing rules embed. |

## User
| Commands | Arguments | Description |
| ------------ | ----------------------------------------- | ---------------------------------------------------------- |
| ban | LowerUserArg, (Delete message days), Text | Ban a member from this guild. |
| getBanReason | User | Get a ban reason for a banned user |
| history, h | User | Use this to view a user's record. |
| selfHistory | | View your infraction history (contents will be DM'd) |
| setBanReason | User, Reason | Set a ban reason for a banned user |
| unban | User | Unban a banned member from this guild. |
| whatpfp | User | Perform a reverse image search of a User's profile picture |
| Commands | Arguments | Description |
| ------------- | ----------------------------------------- | ---------------------------------------------------------- |
| ban | LowerUserArg, (Delete message days), Text | Ban a member from this guild. |
| getBanReason | User | Get a ban reason for a banned user |
| history, h, H | User | Use this to view a user's record. |
| selfHistory | | View your infraction history (contents will be DM'd) |
| setBanReason | User, Reason | Set a ban reason for a banned user |
| unban | User | Unban a banned member from this guild. |
| whatpfp | User | Perform a reverse image search of a User's profile picture |

## Utility
| Commands | Arguments | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import me.ddivad.judgebot.services.DatabaseService
import me.ddivad.judgebot.services.PermissionLevel
import me.ddivad.judgebot.services.PermissionsService
import me.ddivad.judgebot.services.infractions.MuteService
import me.ddivad.judgebot.services.infractions.RoleState
import me.jakejmattson.discordkt.api.dsl.listeners
import me.jakejmattson.discordkt.api.extensions.isSelf
import me.jakejmattson.discordkt.api.extensions.sendPrivateMessage
Expand All @@ -32,8 +33,13 @@ fun onStaffReactionAdd(muteService: MuteService,
if (permissionsService.hasPermission(member, PermissionLevel.Moderator) && !member.isHigherRankedThan(permissionsService, messageAuthor)) {
when (this.emoji.name) {
guildConfiguration.reactions.gagReaction -> {
val target = messageAuthor.asMember(guild.id)
msg.deleteReaction(this.emoji)
muteService.gag(messageAuthor.asMember(guild.id))
if (muteService.checkRoleState(guild, target) == RoleState.Tracked) {
member.sendPrivateMessage("${messageAuthor.mention} is already muted.")
return@on
}
muteService.gag(target)
member.sendPrivateMessage("${messageAuthor.mention} gagged.")
}
guildConfiguration.reactions.historyReaction -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ class MuteService(val configuration: Configuration,
suspend fun initGuilds() {
configuration.guildConfigurations.forEach { config ->
val guild = config.value.id.toSnowflake().let { discord.api.getGuild(it) } ?: return@forEach
initialiseMuteTimers(guild)
setupMutedRole(guild)
runBlocking {
initialiseMuteTimers(guild)
setupMutedRole(guild)
}
}
}

Expand Down Expand Up @@ -115,8 +117,8 @@ class MuteService(val configuration: Configuration,
removeMute(guild, user)
}
}
loggingService.initialiseMutes(guild, getMutedRole(guild))
}
loggingService.initialiseMutes(guild, getMutedRole(guild))
}

suspend fun handleRejoinMute(guild: Guild, member: Member) {
Expand Down