This is the part of function I wrote to rename a voice channel in order to show my Minecraft server’s online status with voice channel name
public static void changeName(String online) {
Guild guild = jda.getGuildById("1122886719126126682");
VoiceChannel channel = guild.getVoiceChannelById("1147195002603184159");
channel.getManager().setName(online).queue(
success -> System.out.println("Successfully renamed to: " + online),
error -> System.out.println("Failed to rename: " + error.getMessage())
);
}
And I got this error (p.s. there are some other printed lines are from other parts of code)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
[main] INFO JDA - Login Successful!
[JDA MainWS-WriteThread] INFO WebSocketClient - Connected to WebSocket
[JDA MainWS-ReadThread] INFO JDA - Finished Loading!
Server is offline
Exception in thread "main" net.dv8tion.jda.api.exceptions.MissingAccessException: Cannot perform action due to a lack of Permission. Missing permission: VOICE_CONNECT
at net.dv8tion.jda.internal.utils.Checks.checkAccess(Checks.java:303)
at net.dv8tion.jda.internal.managers.channel.ChannelManagerImpl.checkPermissions(ChannelManagerImpl.java:763)
at net.dv8tion.jda.internal.managers.channel.ChannelManagerImpl.<init>(ChannelManagerImpl.java:102)
at net.dv8tion.jda.internal.managers.channel.concrete.VoiceChannelManagerImpl.<init>(VoiceChannelManagerImpl.java:27)
at net.dv8tion.jda.internal.entities.channel.concrete.VoiceChannelImpl.getManager(VoiceChannelImpl.java:167)
at Main.changeName(Main.java:93)
at Main.main(Main.java:52
)
I was trying to use this code to rename a voice channel, but it just doesn’t work