-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temp fix: improve contest event moderation
- Loading branch information
1 parent
c5814e9
commit 003cfef
Showing
4 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/com/github/kaktushose/nplaybot/events/contest/MemberExcludeCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.github.kaktushose.nplaybot.events.contest; | ||
|
||
import com.github.kaktushose.jda.commands.annotations.Inject; | ||
import com.github.kaktushose.jda.commands.annotations.interactions.ContextCommand; | ||
import com.github.kaktushose.jda.commands.annotations.interactions.Interaction; | ||
import com.github.kaktushose.jda.commands.annotations.interactions.Permissions; | ||
import com.github.kaktushose.jda.commands.data.EmbedCache; | ||
import com.github.kaktushose.jda.commands.dispatching.interactions.commands.CommandEvent; | ||
import com.github.kaktushose.nplaybot.Database; | ||
import com.github.kaktushose.nplaybot.permissions.BotPermissions; | ||
import net.dv8tion.jda.api.Permission; | ||
import net.dv8tion.jda.api.entities.Message; | ||
import net.dv8tion.jda.api.interactions.commands.Command; | ||
|
||
@Interaction | ||
@Permissions(BotPermissions.MODIFY_USER_BALANCE) | ||
public class MemberExcludeCommand { | ||
|
||
@Inject | ||
private Database database; | ||
@Inject | ||
private EmbedCache embedCache; | ||
|
||
@ContextCommand(value = "Vom Contest ausschließen", type = Command.Type.MESSAGE, isGuildOnly = true, ephemeral = true, enabledFor = Permission.BAN_MEMBERS) | ||
public void onRemoveContestPost(CommandEvent event, Message message) { | ||
database.getContestEventService().setVoteCount(message.getIdLong(), 0); | ||
message.delete().queue(); | ||
event.getGuild().addRoleToMember(message.getAuthor(), message.getGuild().getRoleById(885530505192284210L)).queue(); | ||
event.reply(embedCache.getEmbed("memberExcluded")); | ||
} | ||
|
||
} |