Search in sources :

Example 1 with NewDailyMessage

use of com.github.vaerys.commands.general.NewDailyMessage in project DiscordSailv2 by Vaerys-Dawn.

the class GuildObject method checkToggles.

private void checkToggles() {
    toRemove = new ArrayList<>();
    for (GuildToggle g : toggles) {
        if (!g.enabled(config)) {
            g.execute(this);
        }
    }
    for (GuildToggle g : toRemove) {
        ListIterator iterator = toggles.listIterator();
        while (iterator.hasNext()) {
            GuildToggle toggle = (GuildToggle) iterator.next();
            if (toggle.name() == g.name()) {
                if (g.isModule()) {
                    logger.trace("Module: " + g.name() + " removed.");
                } else {
                    logger.trace("Toggle: " + g.name() + " removed.");
                }
                iterator.remove();
            }
        }
    }
    IChannel channel = client.get().getChannelByID(Globals.queueChannelID);
    if (channel == null) {
        ListIterator iterator = commands.listIterator();
        while (iterator.hasNext()) {
            Command command = (Command) iterator.next();
            if (command.names[0] == new NewDailyMessage().names[0]) {
                logger.trace(longID + ": Removed newDailyMsg command.");
                iterator.remove();
            }
        }
    }
}
Also used : NewDailyMessage(com.github.vaerys.commands.general.NewDailyMessage) Command(com.github.vaerys.templates.Command) GuildToggle(com.github.vaerys.templates.GuildToggle)

Aggregations

NewDailyMessage (com.github.vaerys.commands.general.NewDailyMessage)1 Command (com.github.vaerys.templates.Command)1 GuildToggle (com.github.vaerys.templates.GuildToggle)1