Compare commits

..

No commits in common. "db70d06dc418ec2c5b5989fd65cf6bcf27994e0e" and "f3888cee71cca470fb9f5ce6169f4bf42d6c210c" have entirely different histories.

3 changed files with 14 additions and 20 deletions

View File

@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '3.2.1'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id 'groovy'
@ -47,7 +47,7 @@ dependencies {
implementation('com.sedmelluq:lavaplayer:1.3.78')
implementation('net.dv8tion:JDA:5.0.0-beta.18')
implementation(platform("org.apache.logging.log4j:log4j-bom:2.22.1"))
implementation(platform("org.apache.logging.log4j:log4j-bom:2.22.0"))
implementation group: 'org.hibernate', name: 'hibernate-validator', version: '8.0.1.Final'
// Use MySQL Connector-J
@ -56,11 +56,11 @@ dependencies {
implementation('org.apache.commons:commons-lang3:3.14.0')
liquibaseRuntime('org.liquibase:liquibase-core:4.25.1')
liquibaseRuntime('org.liquibase:liquibase-core:4.25.0')
liquibaseRuntime('org.liquibase:liquibase-groovy-dsl:3.0.3')
liquibaseRuntime('mysql:mysql-connector-java:8.0.33')
liquibaseRuntime group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
liquibaseRuntime group: 'org.liquibase.ext', name: 'liquibase-hibernate5', version: '4.25.1'
liquibaseRuntime group: 'org.liquibase.ext', name: 'liquibase-hibernate5', version: '4.25.0'
liquibaseRuntime 'org.springframework.boot:spring-boot-starter-data-jpa'
liquibaseRuntime 'org.springframework.data:spring-data-jpa'
liquibaseRuntime 'org.springframework:spring-beans'

View File

@ -1,21 +1,14 @@
package net.Broken.Api.Controllers;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import net.Broken.Api.Data.Settings.SettingGroup;
import net.Broken.Api.Data.Settings.Value;
import net.Broken.Api.Services.SettingService;
import net.Broken.DB.Entity.GuildPreferenceEntity;
import net.Broken.Tools.Settings.SettingValueBuilder;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/v2/setting")
@ -39,7 +32,7 @@ public class SettingController {
}
@PostMapping("/{guildId}/values")
@PreAuthorize("@webSecurity.isInGuild(#guildId) && @webSecurity.canManageGuild(#guildId)")
@PreAuthorize("@webSecurity.isInGuild(#guildId) && @webSecurity.anManageGuild(#guildId)")
public List<Value> getSettingValues(@PathVariable String guildId, @RequestBody List<Value> values) {
GuildPreferenceEntity pref = settingService.saveValue(guildId, values);
return new SettingValueBuilder(pref).build();

View File

@ -41,16 +41,17 @@ public class AutoVoiceChannel {
GuildPreferenceEntity pref = SettingsUtils.getInstance().getPreference(guild);
if (pref.isAutoVoice() && voiceChannel.getId().equals(pref.getAutoVoiceChannelID())) {
logger.info("Creating new voice channel for Guild : {}", guild.getName());
AudioChannel newChannel = (AudioChannel) voiceChannel.createCopy().complete();
int next = getNextNumber();
String title = pref.getAutoVoiceChannelTitle();
if (title.isEmpty()) {
title = "Voice @count";
}
title = title.replace("@count", Integer.toString(next));
voiceChannel.createCopy().setName(title).setPosition(voiceChannel.getPosition()).queue(newChannel -> {
moveMembers(voiceChannel.getMembers(), (AudioChannel) newChannel);
newChannel.getManager().setName(title).setPosition(voiceChannel.getPosition()).queue();
createdChannels.put(next, newChannel.getId());
});
moveMembers(voiceChannel.getMembers(), newChannel);
}
}