Skip to content

Commit 8d9f91d

Browse files
Updated TrickCommand
Co-Authored-By: Matt <[email protected]>
1 parent fdbe554 commit 8d9f91d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ dependencies {
7272
testImplementation 'org.junit.jupiter:junit-jupiter'
7373

7474
installer('org.mangorage:installer:4.0.3')
75-
bot('org.mangorage:mangobot:12.0.10')
75+
bot('org.mangorage:mangobot:12.0.19')
7676

7777
library('org.luaj:luaj-jse:3.0.1')
7878
}

src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
requires net.minecraftforge.eventbus;
88
requires java.desktop;
9+
requires annotations;
910

1011
exports org.mangorage.mangobotplugin.entrypoint;
1112
exports org.mangorage.mangobotplugin.commands.trick;

src/main/java/org/mangorage/mangobotplugin/commands/trick/TrickCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import net.dv8tion.jda.api.interactions.components.text.TextInputStyle;
1212
import net.dv8tion.jda.api.interactions.modals.Modal;
1313
import net.dv8tion.jda.api.utils.MarkdownSanitizer;
14+
import org.jetbrains.annotations.Nullable;
1415
import org.mangorage.commonutils.data.DataHandler;
1516
import org.mangorage.commonutils.jda.MessageSettings;
1617
import org.mangorage.commonutils.jda.slash.command.Command;
@@ -544,12 +545,13 @@ public CommandResult execute(Message message, Arguments args) {
544545
return CommandResult.PASS;
545546
}
546547

547-
private void useTrick(Trick trick, Message message, MessageChannel channel, long guildID, Arguments args) {
548+
private void useTrick(Trick trick, @Nullable Message message, MessageChannel channel, long guildID, Arguments args) {
548549
MessageSettings dMessage = plugin.getMessageSettings();
549550
var type = trick.getType();
550-
var replyTarget = message.getMessageReference() == null ? null : message.getMessageReference().getMessage();
551+
var replyTarget = message == null ? null : (message.getMessageReference() == null ? null : message.getMessageReference().getMessage());
551552
boolean shouldPing = false;
552553
if (replyTarget != null && replyTarget.getMember() != null) {
554+
// No ping if hoisted UNLESS not staff.
553555
shouldPing = replyTarget.getMember().getRoles()
554556
.stream().noneMatch((role) -> role.isHoisted() ^ role.getName().equals("Patreons"));
555557
}

0 commit comments

Comments
 (0)