Skip to content

Commit

Permalink
Clean up voice channel effect send
Browse files Browse the repository at this point in the history
  • Loading branch information
freya022 committed Nov 4, 2024
1 parent 78994a1 commit f9245b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ default ChannelAction<VoiceChannel> createCopy()
@Override
@CheckReturnValue
VoiceChannelManager getManager();

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package net.dv8tion.jda.api.events.channel;

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.channel.Channel;
import net.dv8tion.jda.api.entities.channel.VoiceChannelEffect;
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
import net.dv8tion.jda.api.requests.GatewayIntent;
Expand All @@ -34,16 +33,16 @@ public class VoiceChannelEffectSendEvent extends GenericChannelEvent
{
private final VoiceChannelEffect effect;

public VoiceChannelEffectSendEvent(@Nonnull JDA api, long responseNumber, Channel channel, VoiceChannelEffect effect)
public VoiceChannelEffectSendEvent(@Nonnull JDA api, long responseNumber, VoiceChannelEffect effect)
{
super(api, responseNumber, channel);
super(api, responseNumber, effect.getChannel());
this.effect = effect;
}

@Nonnull
public VoiceChannel getVoiceChannel()
{
return getChannel().asVoiceChannel();
return effect.getChannel();
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected Long handleInternally(DataObject content)

VoiceChannelEffect effect = new VoiceChannelEffect(channel, user, emoji, animation, soundboardSound);

api.handleEvent(new VoiceChannelEffectSendEvent(api, responseNumber, channel, effect));
api.handleEvent(new VoiceChannelEffectSendEvent(api, responseNumber, effect));

return null;
}
Expand Down

0 comments on commit f9245b4

Please sign in to comment.