Search in sources :

Example 1 with SetupBack

use of com.github.vaerys.commands.setup.SetupBack in project DiscordSailv2 by Vaerys-Dawn.

the class CommandInit method getSetupCommands.

public static ArrayList<Command> getSetupCommands() {
    ArrayList<Command> commands = new ArrayList<>();
    // step 1
    commands.add(new Module());
    commands.add(new HelpModules());
    // step 2
    commands.add(new Toggle());
    commands.add(new HelpSettings());
    // Setup Traversal Commands
    commands.add(new SetupBack());
    commands.add(new SetupNext());
    commands.add(new SetupQuit());
    commands.add(new SetupRepeat());
    validate(commands);
    return commands;
}
Also used : Command(com.github.vaerys.templates.Command) ArrayList(java.util.ArrayList) SetupQuit(com.github.vaerys.commands.setup.SetupQuit) SetupBack(com.github.vaerys.commands.setup.SetupBack) SetupRepeat(com.github.vaerys.commands.setup.SetupRepeat) SetupNext(com.github.vaerys.commands.setup.SetupNext)

Example 2 with SetupBack

use of com.github.vaerys.commands.setup.SetupBack in project DiscordSailv2 by Vaerys-Dawn.

the class SetupWizard method execute.

@Override
public String execute(String args, CommandObject command) {
    if (SetupHandler.isRunningSetup(command.guild)) {
        return "> Setup is already running for this guild. I can't run it twice!";
    }
    // user can only run setup for one guild at a time
    UserObject user = command.user;
    for (GuildObject guildObject : Globals.getGuilds()) {
        if (guildObject.config.setupUser == user.longID) {
            return "> You're running setup for a different guild. I can't do more than one at a time.";
        }
    }
    // Handle Setup beginning
    String message = "Hi! I'm " + command.client.bot.displayName + " and I'm here to help you get your server set up.\n" + "This guide will walk you through a bunch of commands and things you can do to make your server exactly the way you want it.\n\n" + "You can navigate forwards and backwards in this setup with **" + new SetupBack().getUsage(command) + "** and **" + new SetupNext().getUsage(command) + "**";
    if (command.user.sendDm(message) == null) {
        return "> **ERROR**: I wasn't able to send you a DM! Check your server privacy settings!";
    }
    // send first setup stage response
    SetupHandler.setSetupStage(command, SetupStage.SETUP_MODULES);
    return "> Check your DMs for more instructions.";
}
Also used : GuildObject(com.github.vaerys.masterobjects.GuildObject) UserObject(com.github.vaerys.masterobjects.UserObject) SetupBack(com.github.vaerys.commands.setup.SetupBack) SetupNext(com.github.vaerys.commands.setup.SetupNext)

Aggregations

SetupBack (com.github.vaerys.commands.setup.SetupBack)2 SetupNext (com.github.vaerys.commands.setup.SetupNext)2 SetupQuit (com.github.vaerys.commands.setup.SetupQuit)1 SetupRepeat (com.github.vaerys.commands.setup.SetupRepeat)1 GuildObject (com.github.vaerys.masterobjects.GuildObject)1 UserObject (com.github.vaerys.masterobjects.UserObject)1 Command (com.github.vaerys.templates.Command)1 ArrayList (java.util.ArrayList)1