Compare commits
15 Commits
f3888cee71
...
db70d06dc4
Author | SHA1 | Date | |
---|---|---|---|
|
db70d06dc4 | ||
|
5bb2f20221 | ||
|
2217690daa | ||
|
42ccdfcab0 | ||
|
8bfb7de8a5 | ||
3ef747295a | |||
170b3597f4 | |||
f752ffb1b1 | |||
4d1fbd875d | |||
|
db5ff0c3c4 | ||
|
77b32c7e93 | ||
|
6a01048875 | ||
|
2131ab2801 | ||
|
1ee3e59bc5 | ||
|
989bec74e5 |
@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '3.2.0'
|
||||
id 'org.springframework.boot' version '3.2.1'
|
||||
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.0"))
|
||||
implementation(platform("org.apache.logging.log4j:log4j-bom:2.22.1"))
|
||||
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.0')
|
||||
liquibaseRuntime('org.liquibase:liquibase-core:4.25.1')
|
||||
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.0'
|
||||
liquibaseRuntime group: 'org.liquibase.ext', name: 'liquibase-hibernate5', version: '4.25.1'
|
||||
liquibaseRuntime 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
liquibaseRuntime 'org.springframework.data:spring-data-jpa'
|
||||
liquibaseRuntime 'org.springframework:spring-beans'
|
||||
|
@ -1,14 +1,21 @@
|
||||
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")
|
||||
@ -32,7 +39,7 @@ public class SettingController {
|
||||
}
|
||||
|
||||
@PostMapping("/{guildId}/values")
|
||||
@PreAuthorize("@webSecurity.isInGuild(#guildId) && @webSecurity.anManageGuild(#guildId)")
|
||||
@PreAuthorize("@webSecurity.isInGuild(#guildId) && @webSecurity.canManageGuild(#guildId)")
|
||||
public List<Value> getSettingValues(@PathVariable String guildId, @RequestBody List<Value> values) {
|
||||
GuildPreferenceEntity pref = settingService.saveValue(guildId, values);
|
||||
return new SettingValueBuilder(pref).build();
|
||||
|
@ -41,17 +41,16 @@ 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));
|
||||
newChannel.getManager().setName(title).setPosition(voiceChannel.getPosition()).queue();
|
||||
|
||||
voiceChannel.createCopy().setName(title).setPosition(voiceChannel.getPosition()).queue(newChannel -> {
|
||||
moveMembers(voiceChannel.getMembers(), (AudioChannel) newChannel);
|
||||
createdChannels.put(next, newChannel.getId());
|
||||
moveMembers(voiceChannel.getMembers(), newChannel);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user