Search in sources :

Example 81 with TextChannel

use of net.dv8tion.jda.core.entities.TextChannel in project Rubicon by Rubicon-Bot.

the class ServerLogHandler method onGuildVoiceJoin.

@Override
public void onGuildVoiceJoin(GuildVoiceJoinEvent event) {
    if (!isEventEnabled(event.getGuild(), LogEventKeys.VOICE))
        return;
    TextChannel textChannel = getLogChannel(event.getGuild());
    if (textChannel == null)
        return;
    EmbedBuilder embedBuilder = new EmbedBuilder();
    embedBuilder.setAuthor("A member created voice connection", null, event.getMember().getUser().getAvatarUrl());
    embedBuilder.setDescription("**" + event.getMember().getEffectiveName() + " (" + event.getMember().getUser().getId() + ")** joined `" + event.getChannelJoined().getName() + "`");
    embedBuilder.setColor(evVoiceLog);
    sendLog(textChannel, embedBuilder);
}
Also used : TextChannel(net.dv8tion.jda.core.entities.TextChannel) EmbedBuilder(net.dv8tion.jda.core.EmbedBuilder)

Example 82 with TextChannel

use of net.dv8tion.jda.core.entities.TextChannel in project Rubicon by Rubicon-Bot.

the class ServerLogHandler method onGuildMemberRoleRemove.

@Override
public void onGuildMemberRoleRemove(GuildMemberRoleRemoveEvent event) {
    if (!isEventEnabled(event.getGuild(), LogEventKeys.ROLE))
        return;
    TextChannel textChannel = getLogChannel(event.getGuild());
    if (textChannel == null)
        return;
    EmbedBuilder embedBuilder = new EmbedBuilder();
    embedBuilder.setAuthor("A member role was updated", null, event.getUser().getAvatarUrl());
    embedBuilder.setDescription("Removed **" + event.getRoles().get(0).getName() + "** from **" + event.getMember().getEffectiveName() + " (" + event.getMember().getUser().getId() + ")**");
    embedBuilder.setColor(evRoleRemoved);
    sendLog(textChannel, embedBuilder);
}
Also used : TextChannel(net.dv8tion.jda.core.entities.TextChannel) EmbedBuilder(net.dv8tion.jda.core.EmbedBuilder)

Example 83 with TextChannel

use of net.dv8tion.jda.core.entities.TextChannel in project Rubicon by Rubicon-Bot.

the class ServerLogHandler method onGuildBan.

@Override
public void onGuildBan(GuildBanEvent event) {
    if (!isEventEnabled(event.getGuild(), LogEventKeys.BAN))
        return;
    TextChannel textChannel = getLogChannel(event.getGuild());
    if (textChannel == null)
        return;
    bannedUsers.add(event.getUser().getIdLong());
    EmbedBuilder embedBuilder = new EmbedBuilder();
    embedBuilder.setAuthor("A member was banned", null, event.getUser().getAvatarUrl());
    embedBuilder.setDescription("**" + event.getUser().getName() + " (" + event.getUser().getId() + ")** was banned from the server");
    embedBuilder.setColor(evBanColor);
    sendLog(textChannel, embedBuilder);
}
Also used : TextChannel(net.dv8tion.jda.core.entities.TextChannel) EmbedBuilder(net.dv8tion.jda.core.EmbedBuilder)

Example 84 with TextChannel

use of net.dv8tion.jda.core.entities.TextChannel in project Rubicon by Rubicon-Bot.

the class ServerLogHandler method logCommand.

public static void logCommand(CommandManager.ParsedCommandInvocation parsedCommandInvocation) {
    if (!isEventEnabled(parsedCommandInvocation.getMessage().getGuild(), LogEventKeys.COMMAND))
        return;
    TextChannel textChannel = getLogChannel(parsedCommandInvocation.getMessage().getGuild());
    if (textChannel == null)
        return;
    EmbedBuilder embedBuilder = new EmbedBuilder();
    embedBuilder.setAuthor("A command was executed", null);
    embedBuilder.setDescription("**" + parsedCommandInvocation.getMessage().getMember().getEffectiveName() + " (" + parsedCommandInvocation.getMessage().getMember().getUser().getId() + ")** executed `" + parsedCommandInvocation.getPrefix() + parsedCommandInvocation.getCommandInvocation() + "`");
    embedBuilder.setColor(evCommandLog);
    sendLog(textChannel, embedBuilder);
}
Also used : TextChannel(net.dv8tion.jda.core.entities.TextChannel) EmbedBuilder(net.dv8tion.jda.core.EmbedBuilder)

Example 85 with TextChannel

use of net.dv8tion.jda.core.entities.TextChannel in project Rubicon by Rubicon-Bot.

the class ServerLogHandler method onGuildVoiceLeave.

@Override
public void onGuildVoiceLeave(GuildVoiceLeaveEvent event) {
    if (!isEventEnabled(event.getGuild(), LogEventKeys.VOICE))
        return;
    TextChannel textChannel = getLogChannel(event.getGuild());
    if (textChannel == null)
        return;
    EmbedBuilder embedBuilder = new EmbedBuilder();
    embedBuilder.setAuthor("A member closed voice connection", null, event.getMember().getUser().getAvatarUrl());
    embedBuilder.setDescription("**" + event.getMember().getEffectiveName() + " (" + event.getMember().getUser().getId() + ")** left `" + event.getChannelLeft().getName() + "`");
    embedBuilder.setColor(evVoiceLog);
    sendLog(textChannel, embedBuilder);
}
Also used : TextChannel(net.dv8tion.jda.core.entities.TextChannel) EmbedBuilder(net.dv8tion.jda.core.EmbedBuilder)

Aggregations

TextChannel (net.dv8tion.jda.core.entities.TextChannel)90 EmbedBuilder (net.dv8tion.jda.core.EmbedBuilder)27 Guild (net.dv8tion.jda.core.entities.Guild)21 User (net.dv8tion.jda.core.entities.User)19 Member (net.dv8tion.jda.core.entities.Member)18 List (java.util.List)17 Message (net.dv8tion.jda.core.entities.Message)17 ArrayList (java.util.ArrayList)14 VoiceChannel (net.dv8tion.jda.core.entities.VoiceChannel)13 GuildWrapper (stream.flarebot.flarebot.objects.GuildWrapper)13 MessageUtils (stream.flarebot.flarebot.util.MessageUtils)13 Collectors (java.util.stream.Collectors)10 CommandType (stream.flarebot.flarebot.commands.CommandType)8 Role (net.dv8tion.jda.core.entities.Role)7 FlareBot (stream.flarebot.flarebot.FlareBot)7 Track (com.arsenarsen.lavaplayerbridge.player.Track)6 MessageEmbed (net.dv8tion.jda.core.entities.MessageEmbed)6 MantaroData (net.kodehawa.mantarobot.data.MantaroData)6 DBGuild (net.kodehawa.mantarobot.db.entities.DBGuild)6 EmoteReference (net.kodehawa.mantarobot.utils.commands.EmoteReference)6