CTCV2/app/src/main/java/com/discord/widgets/chat/input/WidgetChatInputCommandsMode...

101 lines
2.4 KiB
Java

package com.discord.widgets.chat.input;
import androidx.annotation.Nullable;
import com.PatchConfig;
import java.util.Collection;
import java.util.Map;
import java.util.regex.Pattern;
import cutthecord.commands.CommandHandler;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexIgnore;
import lanchon.dexpatcher.annotation.DexWrap;
@DexEdit
public class WidgetChatInputCommandsModel implements TagObject, Comparable<WidgetChatInputCommandsModel> {
// slashcommands patch
@DexWrap
private static Collection<WidgetChatInputCommandsModel> createBuiltInSlashCommands() {
Collection<WidgetChatInputCommandsModel> commands = createBuiltInSlashCommands();
if (!PatchConfig.SLASH_COMMANDS_ENABLED) {
// Patch not enabled
return commands;
}
// Naughty workaround to get default slashaction
WidgetChatInputCommandsModel o = (WidgetChatInputCommandsModel) commands.toArray()[0];
WidgetChatInputSlashAction defaultSlashAction = o.slashAction;
// Register our info messages
for (Map.Entry<String, String> infoTexts : CommandHandler.getPopupInfo().entrySet()) {
commands.add(createSlashCommand(infoTexts.getKey(), "{CTC_COMMAND}", infoTexts.getValue(), defaultSlashAction));
}
return commands;
}
// end of slashcommands patch
@DexIgnore
private static WidgetChatInputCommandsModel createSlashCommand(String cmd, String str2, @Nullable String info, WidgetChatInputSlashAction widgetChatInputSlashAction) {
return null;
}
@DexIgnore
@Nullable
private WidgetChatInputSlashAction slashAction;
// Interfaces....
@DexIgnore
@Override
public String getDisplayTag() {
return null;
}
@DexIgnore
@Override
public String getTag() {
return null;
}
@DexIgnore
@Override
public Pattern getTagRegex() {
return null;
}
@DexIgnore
@Override
public String getKey() {
return null;
}
@DexIgnore
@Override
public int getType() {
return 0;
}
@DexIgnore
@Override
public int compareTo(WidgetChatInputCommandsModel o) {
return 0;
}
// End of interfaces
// Other class methods
@DexIgnore
@Nullable
public String getSlashOutput() {
return null;
}
}