// TODO: Modlog?
private void processCommands(GuildMessageReceivedEvent event, GuildData guildData, String trigger, String[] args, boolean isMention) {
        ICommandMain cmd = CascadeBot.INS.getCommandManager().getCommand(trigger, event.getAuthor(), guildData);
        if (cmd != null) {
            if (cmd.getModule().isPublicModule() &&
                    !guildData.isModuleEnabled(cmd.getModule())) {
                if (guildData.getSettings().willDisplayModuleErrors() || Environment.isDevelopment()) {
                    EmbedBuilder builder = MessagingObjects.getClearThreadLocalEmbedBuilder();
                    builder.setDescription(String.format("The module `%s` for command `%s` is disabled!", cmd.getModule().toString(), trigger));
                    builder.setTimestamp(Instant.now());
                    builder.setFooter("Requested by " + event.getAuthor().getAsTag(), event.getAuthor().getEffectiveAvatarUrl());
                    Messaging.sendDangerMessage(event.getChannel(), builder, guildData.getSettings().useEmbedForMessages());
                }
                // TODO: Modlog?
                return;
            }
            CommandContext context = new CommandContext(
                    event.getJDA(),
                    event.getChannel(),
                    event.getMessage(),
                    event.getGuild(),
                    guildData,
                    args,
                    event.getMember(),
                    trigger,
                    isMention
            );
            if (args.length >= 1) {
                if (processSubCommands(cmd, args, context)) {
                    return;
                }
            }
            dispatchCommand(cmd, context);
        }
    }
Messaging.sendDangerMessage(event.getChannel(), builder, guildData.getSettings().useEmbedForMessages());
}
// TODO: Modlog?
return;
}
if (cmd != null) {
if (cmd.getModule().isPublicModule() &&
!guildData.isModuleEnabled(cmd.getModule())) {
if (guildData.getSettings().willDisplayModuleErrors() || Environment.isDevelopment()) {
EmbedBuilder builder = MessagingObjects.getClearThreadLocalEmbedBuilder();
builder.setDescription(String.format("The module `%s` for command `%s` is disabled!", cmd.getModule().toString(), trigger));
builder.setTimestamp(Instant.now());
builder.setFooter("Requested by " + event.getAuthor().getAsTag(), event.getAuthor().getEffectiveAvatarUrl());
Messaging.sendDangerMessage(event.getChannel(), builder, guildData.getSettings().useEmbedForMessages());
}
// TODO: Modlog?
return;
}
CommandContext context = new CommandContext(
event.getJDA(),
event.getChannel(),
event.getMessage(),
event.getGuild(),
guildData,
args,
event.getMember(),
private void processCommands(GuildMessageReceivedEvent event, GuildData guildData, String trigger, String[] args, boolean isMention) {
ICommandMain cmd = CascadeBot.INS.getCommandManager().getCommand(trigger, event.getAuthor(), guildData);
if (cmd != null) {
if (cmd.getModule().isPublicModule() &&
!guildData.isModuleEnabled(cmd.getModule())) {
if (guildData.getSettings().willDisplayModuleErrors() || Environment.isDevelopment()) {
EmbedBuilder builder = MessagingObjects.getClearThreadLocalEmbedBuilder();
builder.setDescription(String.format("The module `%s` for command `%s` is disabled!", cmd.getModule().toString(), trigger));
builder.setTimestamp(Instant.now());
builder.setFooter("Requested by " + event.getAuthor().getAsTag(), event.getAuthor().getEffectiveAvatarUrl());
Messaging.sendDangerMessage(event.getChannel(), builder, guildData.getSettings().useEmbedForMessages());
}
// TODO: Modlog?
return;
}
CommandContext context = new CommandContext(
event.getJDA(),
event.getChannel(),
event.getMessage(),
event.getGuild(),
guildData,
args,
event.getMember(),
trigger,
isMention
);
if (args.length >= 1) {
if (processSubCommands(cmd, args, context)) {
return;
}
}
dispatchCommand(cmd, context);
}