Skip to content

Commit

Permalink
Merge pull request #27 from Softawii/feature/rolepackage
Browse files Browse the repository at this point in the history
Feature/rolepackage
  • Loading branch information
yaansz authored Jun 7, 2022
2 parents 93fb24f + 7d9b7d9 commit 1c09942
Show file tree
Hide file tree
Showing 6 changed files with 472 additions and 92 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group 'com.softwaii.capivara'
version '1.0.1.1'
version '1.0.1.4'


repositories {
Expand Down Expand Up @@ -57,5 +57,5 @@ test {
useJUnitPlatform()
}

sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
8 changes: 6 additions & 2 deletions src/main/java/com/softawii/capivara/config/SpringConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.softawii.curupira.core.Curupira;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.requests.GatewayIntent;
import net.dv8tion.jda.api.utils.MemberCachePolicy;
import net.dv8tion.jda.api.utils.cache.CacheFlag;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -57,8 +59,10 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
public JDA jda() {
JDA jda;
try {
JDABuilder builder = JDABuilder.createDefault(discordToken);
builder.enableCache(CacheFlag.EMOTE, CacheFlag.ROLE_TAGS);
JDABuilder builder = JDABuilder.create(discordToken, GatewayIntent.GUILD_MEMBERS);
builder.enableIntents(GatewayIntent.GUILD_EMOJIS);
builder.setMemberCachePolicy(MemberCachePolicy.ALL);
builder.enableCache(CacheFlag.EMOTE, CacheFlag.ROLE_TAGS, CacheFlag.MEMBER_OVERRIDES);
builder.addEventListeners(new PackageGroup.AutoCompleter());
jda = builder.build();
jda.awaitReady();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public MessageEmbed getGuildPackages(Long guildId, List<Role> roles, boolean sho
String name = key.getName();
String description = pkg.getDescription();

if(description != null) sb.append("*").append(description).append("*\n\n");
if(!description.isBlank()) sb.append("*").append(description).append("*\n\n");

pkg.getRoles().forEach(role -> {
Long roleId = role.getRoleId();
Expand Down
Loading

0 comments on commit 1c09942

Please sign in to comment.