src/main/java/me/evyn/bot/listeners/ActivityListener.java
@Override
    public void onGuildMemberRoleAdd(GuildMemberRoleAddEvent event) {
        long guildId = event.getGuild().getIdLong();

        TextChannel actLogChannel = ActivityLogs.getActivityChannel(event, guildId);

        if (actLogChannel != null) {
            StringBuilder sb = new StringBuilder();
            event.getRoles().stream()
                    .forEach(role -> sb.append(role.getName()).append(", "));

            sb.delete(sb.length() - 2, sb.length());

            boolean embed = DataSourceCollector.getGuildEmbed(guildId);
            if (embed) {
                EmbedBuilder eb = new EmbedBuilder();
                eb.setAuthor(event.getUser().getAsTag() + " (" + event.getUser().getId() + ")",
                        event.getUser().getAvatarUrl(), event.getUser().getAvatarUrl())
                        .setDescription("Added to new role: **" + sb.toString() + "**")
                        .setColor(0x005AFF)
                        .setFooter("Role update.")
                        .setTimestamp(Instant.now());

                actLogChannel.sendMessage(eb.build()).queue();
            } else {
                actLogChannel.sendMessage("User " + event.getUser().getAsTag() + "(" +
                        event.getUser().getId() + ") Added to new role: **" + sb.toString() + "**").queue();
            }
        }
    }
/**
     * If activity logs are enabled, sends log on guild member role add
     * @param event GuildMemberRoleAddEvent
     */
If activity logs are enabled, sends log on guild member role add
@param event GuildMemberRoleAddEvent
If activity logs are enabled sends log on guild member role add @param event GuildMemberRoleAddEvent
@Override
    public void onGuildMemberRoleAdd(GuildMemberRoleAddEvent event) {
        long guildId = event.getGuild().getIdLong();
        TextChannel actLogChannel = ActivityLogs.getActivityChannel(event, guildId);
        if (actLogChannel != null) {
            StringBuilder sb = new StringBuilder();
            event.getRoles().stream()
                    .forEach(role -> sb.append(role.getName()).append(", "));
            sb.delete(sb.length() - 2, sb.length());
            boolean embed = DataSourceCollector.getGuildEmbed(guildId);
            if (embed) {
                EmbedBuilder eb = new EmbedBuilder();
                eb.setAuthor(event.getUser().getAsTag() + " (" + event.getUser().getId() + ")",
                        event.getUser().getAvatarUrl(), event.getUser().getAvatarUrl())
                        .setDescription("Added to new role: **" + sb.toString() + "**")
                        .setColor(0x005AFF)
                        .setFooter("Role update.")
                        .setTimestamp(Instant.now());
                actLogChannel.sendMessage(eb.build()).queue();
            } else {
                actLogChannel.sendMessage("User " + event.getUser().getAsTag() + "(" +
                        event.getUser().getId() + ") Added to new role: **" + sb.toString() + "**").queue();
            }
        }
    }
@ Override public void onGuildMemberRoleAdd ( GuildMemberRoleAddEvent event ) { long guildId = event . getGuild ( ) . getIdLong ( ) ; TextChannel actLogChannel = ActivityLogs . getActivityChannel ( event , guildId ) ; if ( actLogChannel != null ) { StringBuilder sb = new StringBuilder ( ) ; event . getRoles ( ) . stream ( ) . forEach ( role -> sb . append ( role . getName ( ) ) . append ( ", " ) ) ; sb . delete ( sb . length ( ) - 2 , sb . length ( ) ) ; boolean embed = DataSourceCollector . getGuildEmbed ( guildId ) ; if ( embed ) { EmbedBuilder eb = new EmbedBuilder ( ) ; eb . setAuthor ( event . getUser ( ) . getAsTag ( ) + " (" + event . getUser ( ) . getId ( ) + ")" , event . getUser ( ) . getAvatarUrl ( ) , event . getUser ( ) . getAvatarUrl ( ) ) . setDescription ( "Added to new role: **" + sb . toString ( ) + "**" ) . setColor ( 0x005AFF ) . setFooter ( "Role update." ) . setTimestamp ( Instant . now ( ) ) ; actLogChannel . sendMessage ( eb . build ( ) ) . queue ( ) ; } else { actLogChannel . sendMessage ( "User " + event . getUser ( ) . getAsTag ( ) + "(" + event . getUser ( ) . getId ( ) + ") Added to new role: **" + sb . toString ( ) + "**" ) . queue ( ) ; } } }
If activity logs are enabled, sends log on guild member role add
 @param event GuildMemberRoleAddEvent
If activity logs are enabled sends log on guild member role add @param event GuildMemberRoleAddEvent