This repository has been archived on 2021-08-24. You can view files and clone it, but cannot push or open issues or pull requests.
cutthecord/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdCtc.java

131 lines
3.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*package com.cutthecord.commands.commands;
import com.cutthecord.commands.CommandHandler;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUserSettings;
public class CmdCtc extends CommandHandler.PrivateCommand {
// TODO make token calls write directly to clipboard
// TODO replace patched method calls with reflection
@Override
public String getPopupInfo() {
return "cheese";
}
public static class CmdCtcChannelLeak extends CommandHandler.PrivateCommand {
@Override
public String handleCommand(String msg) {
StoreStream.getUserSettings().setLeakChannels(msg.startsWith("false"));
return "CTC: Successfully set channelleak state.";
}
@Override
public String getPopupInfo() {
return "Shows all channels, even those you dont have permissions to view";
}
}
public static class CmdCtcShowTyping extends CommandHandler.PrivateCommand {
@Override
public String handleCommand(String msg) {
StoreStream.getUserSettings().setShowTyping(msg.startsWith("true"));
return "CTC: Successfully set showtyping state.";
}
@Override
public String getPopupInfo() {
return "Change typing event so that its visible/not when you type";
}
}
public static class CmdCtcToken extends CommandHandler.PrivateCommand {
@Override
public String handleCommand(String msg) {
if (msg.isEmpty()) {
// Print token
return StoreStream.getUserSettings().getStoredToken();
}
// Set token
StoreStream.getUserSettings().setStoredToken(msg);
return "CTC: Successfully changed token. Please restart application.";
}
@Override
public String getPopupInfo() {
return "Gives or sets token";
}
}
public static class CmdCtcAccount extends CommandHandler.PrivateCommand {
@Override
public String handleCommand(String msg) {
String trim = msg.trim();
StoreUserSettings userSettings = StoreStream.getUserSettings();
String accountToken = userSettings.getAccountToken(trim);
if (accountToken.startsWith("none")) {
return "CTC: No such account found.";
}
userSettings.setStoredToken(accountToken);
return "CTC: Successfully changed accounts. Please restart application.";
}
@Override
public String getPopupInfo() {
return "Switches to the account specified";
}
}
public static class CmdCtcAddAccount extends CommandHandler.PrivateCommand {
@Override
public String handleCommand(String msg) {
String substring3 = msg.substring(msg.indexOf(" "));
String trim2 = msg.replace(substring3, "").trim();
String trim3 = substring3.trim();
StoreUserSettings userSettings2 = StoreStream.getUserSettings();
if (trim2.startsWith("current")) {
trim2 = userSettings2.getStoredToken();
}
userSettings2.setAccountToken(trim2, trim3);
return "CTC: Added account.";
}
@Override
public String getPopupInfo() {
return "Adds an account to the account switcher";
}
}
public static class CmdCtcNoDelete extends CommandHandler.PrivateCommand {
@Override
public String handleCommand(String msg) {
StoreStream.getUserSettings().setNoDelete(msg.startsWith("true"));
return "CTC: Successfully set nodelete state.";
}
@Override
public String getPopupInfo() {
return "Disables handling of message delete events";
}
}
}
*/