Skip to content

Commit

Permalink
update to match core
Browse files Browse the repository at this point in the history
and missed mention removal
  • Loading branch information
mcmonkey4eva committed Feb 21, 2022
1 parent 347b8d7 commit d5843cd
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
Expand Up @@ -99,7 +99,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
scriptEntry.addObject("id", new ElementTag(CoreUtilities.toLowerCase(arg.getValue())));
}
else if (!scriptEntry.hasObject("instruction")
&& arg.matchesEnum(DiscordInstruction.values())) {
&& arg.matchesEnum(DiscordInstruction.class)) {
scriptEntry.addObject("instruction", arg.asElement());
}
else if (!scriptEntry.hasObject("code")
Expand Down
Expand Up @@ -108,7 +108,7 @@ public enum DiscordCommandInstruction { CREATE, PERMS, DELETE }
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
for (Argument arg : scriptEntry) {
if (!scriptEntry.hasObject("instruction")
&& arg.matchesEnum(DiscordCommandInstruction.values())) {
&& arg.matchesEnum(DiscordCommandInstruction.class)) {
scriptEntry.addObject("instruction", arg.asElement());
}
else if (!scriptEntry.hasObject("group")
Expand Down
Expand Up @@ -89,7 +89,7 @@ else if (!scriptEntry.hasObject("tokenfile")
}
else if (!scriptEntry.hasObject("intents")
&& arg.matchesPrefix("intents")
&& arg.matchesEnum(GatewayIntent.values())) {
&& arg.matchesEnum(GatewayIntent.class)) {
scriptEntry.addObject("intents", arg.asType(ListTag.class));
}
else {
Expand Down
Expand Up @@ -87,7 +87,7 @@ public enum DiscordInteractionInstruction { DEFER, REPLY, EDIT, DELETE }
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
for (Argument arg : scriptEntry) {
if (!scriptEntry.hasObject("instruction")
&& arg.matchesEnum(DiscordInteractionInstruction.values())) {
&& arg.matchesEnum(DiscordInteractionInstruction.class)) {
scriptEntry.addObject("instruction", arg.asElement());
}
else if (!scriptEntry.hasObject("message")) {
Expand Down
Expand Up @@ -75,7 +75,7 @@ public enum DiscordReactInstruction { ADD, REMOVE, CLEAR }
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {
for (Argument arg : scriptEntry) {
if (!scriptEntry.hasObject("instruction")
&& arg.matchesEnum(DiscordReactInstruction.values())) {
&& arg.matchesEnum(DiscordReactInstruction.class)) {
scriptEntry.addObject("instruction", arg.asElement());
}
else if (!scriptEntry.hasObject("channel")
Expand Down
Expand Up @@ -171,6 +171,7 @@ public void reapplyTracker(AbstractFlagTracker tracker) {
public static AsciiMatcher digits = new AsciiMatcher(AsciiMatcher.DIGITS);

public static String stripMentions(String message) {
message = message.replace("@everyone", "");
StringBuilder output = new StringBuilder(message.length());
char[] rawChars = message.toCharArray();
for (int i = 0; i < rawChars.length; i++) {
Expand Down

0 comments on commit d5843cd

Please sign in to comment.