Vom Bra muss der Benzer

This commit is contained in:
Hax 2020-01-16 21:00:54 +01:00
parent e2bd886eb9
commit 054d967b70
3 changed files with 51 additions and 1 deletions

View file

@ -103,7 +103,8 @@ public class Hadder {
new StopCommand(), new StopCommand(),
new BlacklistCommand(), new BlacklistCommand(),
new PauseCommand(), new PauseCommand(),
new LoopCommand()), config, helpCommand); new LoopCommand(),
new BassCommand()), config, helpCommand);
builder.addEventListeners( builder.addEventListeners(
new MentionListener(rethink), new MentionListener(rethink),

View file

@ -30,6 +30,7 @@ public class AudioManager {
public AudioManager() { public AudioManager() {
AudioSourceManagers.registerRemoteSources(myManager); AudioSourceManagers.registerRemoteSources(myManager);
myManager.getConfiguration().setFilterHotSwapEnabled(true);
} }
public boolean hasPlayer(Guild guild) { public boolean hasPlayer(Guild guild) {

View file

@ -0,0 +1,48 @@
/*
* @author Hax / Hax6775 / Schlauer_Hax
*/
package com.bbn.hadder.commands.music;
import com.bbn.hadder.commands.Command;
import com.bbn.hadder.commands.CommandEvent;
import com.sedmelluq.discord.lavaplayer.filter.equalizer.EqualizerFactory;
public class BassCommand implements Command {
private static final float[] BASS_BOOST = { 0.2f, 0.15f, 0.1f, 0.05f, 0.0f, -0.05f, -0.1f, -0.1f, -0.1f, -0.1f, -0.1f,
-0.1f, -0.1f, -0.1f, -0.1f };
@Override
public void executed(String[] args, CommandEvent event) {
if (args.length==1) {
float value = Float.parseFloat(args[0]);
EqualizerFactory equalizer = new EqualizerFactory();
for (int i = 0; i < BASS_BOOST.length; i++) {
equalizer.setGain(i, BASS_BOOST[i] + value);
}
event.getAudioManager().getPlayer(event.getGuild()).setFrameBufferDuration(500);
event.getAudioManager().getPlayer(event.getGuild()).setFilterFactory(equalizer);
event.getTextChannel().sendMessage("Bruh, set dae bass").queue();
}
}
@Override
public String[] labels() {
return new String[]{"bass"};
}
@Override
public String description() {
return null;
}
@Override
public String usage() {
return null;
}
@Override
public String example() {
return null;
}
}