Hax dev #335

Merged
greg6775 merged 3 commits from hax-dev into greg-dev 2020-01-20 17:56:00 +01:00
14 changed files with 55 additions and 19 deletions
Showing only changes of commit 1386a468d3 - Show all commits

View file

@ -27,7 +27,7 @@
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.1.0_97</version>
<version>4.1.0_99</version>
</dependency>
<dependency>
<groupId>org.json</groupId>

View file

@ -119,7 +119,7 @@ public class Hadder {
try {
shardManager = builder.build();
} catch (LoginException e) {
} catch (Exception e) {
e.printStackTrace();
}
}

View file

@ -48,10 +48,10 @@ public class TrackManager extends AudioEventAdapter {
@Override
public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) {
Guild g = queue.element().getAuthor().getGuild();
if (loop) {
player.playTrack(track.makeClone());
} else if (queue.isEmpty()) {
Guild g = queue.poll().getAuthor().getGuild();
g.getAudioManager().closeAudioConnection();
} else {
player.playTrack(queue.element().getTrack().makeClone());

View file

@ -79,6 +79,9 @@ public class GitHubCommand implements Command {
}
}
} else {
event.getHelpCommand().sendHelp(this, event);
/*
TODO: THIS
event.getTextChannel().sendMessage(
event.getMessageEditor().getMessage(
MessageEditor.MessageType.INFO,
@ -86,7 +89,7 @@ public class GitHubCommand implements Command {
"",
"commands.misc.github.connect.description",
"(https://github.com/login/oauth/authorize?client_id=25321f690bb1b6952942)")
.build()).queue();
.build()).queue(); */
}
}

View file

@ -1,11 +1,12 @@
/*
* @author Hax / Hax6775 / Schlauer_Hax
@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.bbn.hadder.utils.MessageEditor;
import com.sedmelluq.discord.lavaplayer.filter.equalizer.EqualizerFactory;
public class BassCommand implements Command {
@ -14,16 +15,28 @@ public class BassCommand implements Command {
@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);
if (args.length > 0) {
if (event.getAudioManager().hasPlayer(event.getGuild()) && event.getAudioManager().getPlayer(event.getGuild()).getPlayingTrack() != null) {
if (event.getMember().getVoiceState().inVoiceChannel() && event.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && event.getGuild().getSelfMember().getVoiceState().getChannel().equals(event.getMember().getVoiceState().getChannel())) {
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);
} else {
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.music.bass.error.connected.title",
"commands.music.bass.error.connected.description")
.build()).queue();
}
} else {
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.music.info.error.title",
"commands.music.info.error.description").build()).queue();
}
event.getAudioManager().getPlayer(event.getGuild()).setFrameBufferDuration(500);
event.getAudioManager().getPlayer(event.getGuild()).setFilterFactory(equalizer);
event.getTextChannel().sendMessage("Bruh, set dae bass").queue();
}
} else event.getHelpCommand().sendHelp(this, event);
}
@Override
@ -33,16 +46,16 @@ public class BassCommand implements Command {
@Override
public String description() {
return null;
return "commands.music.bass.help.description";
}
@Override
public String usage() {
return null;
return "[Bass-Level]";
}
@Override
public String example() {
return null;
return "1000";
}
}

View file

@ -35,7 +35,7 @@ public class VolumeCommand implements Command {
} else {
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.music.volume.error.connected.title",
"commands.volume.stop.error.connected.description")
"commands.music.volume.error.connected.description")
.build()).queue();
}
} else {

View file

@ -13,7 +13,6 @@ public class MentionListener extends ListenerAdapter {
private Rethink rethink;
public MentionListener(Rethink rethink) {
this.rethink = rethink;
}

View file

@ -174,6 +174,9 @@ commands.moderation.editrules.success.title = Successfully changed
commands.moderation.editrules.success.description = I successfully changed the rules
commands.moderation.editrules.help.description = Edits the rules message.
commands.music.bass.error.connected.title = No channel
commands.music.bass.error.connected.description = You have to be in the same voice channel as the bot to change the bass level.
commands.music.bass.help.description = Change the bass for the song which is played at the moment.
commands.music.join.success.title = Successfully connected
commands.music.join.success.description = Ich habe mich erfolgreich mit %extra% verbunden.
commands.music.join.error.connecting.already.title = Already connected

View file

@ -174,6 +174,9 @@ commands.moderation.editrules.success.title = Successfully changed
commands.moderation.editrules.success.description = I successfully changed the rules
commands.moderation.editrules.help.description = Edits the rules message.
commands.music.bass.error.connected.title = No channel
commands.music.bass.error.connected.description = You have to be in the same voice channel as the bot to change the bass level.
commands.music.bass.help.description = Change the bass for the song which is played at the moment.
commands.music.join.success.title = Successfully connected
commands.music.join.success.description = I successfully connected to %extra%.
commands.music.join.error.connecting.already.title = Already connected

View file

@ -174,6 +174,9 @@ commands.moderation.editrules.success.title = Successfully changed
commands.moderation.editrules.success.description = I successfully changed the rules
commands.moderation.editrules.help.description = Edits the rules message.
commands.music.bass.error.connected.title = No channel
commands.music.bass.error.connected.description = You have to be in the same voice channel as the bot to change the bass level.
commands.music.bass.help.description = Change the bass for the song which is played at the moment.
commands.music.join.success.title = Successfully connected
commands.music.join.success.description = I successfully connected to %extra%.
commands.music.join.error.connecting.already.title = Already connected

View file

@ -174,6 +174,9 @@ commands.moderation.editrules.success.title = Successfully changed
commands.moderation.editrules.success.description = I successfully changed the rules
commands.moderation.editrules.help.description = Edits the rules message.
commands.music.bass.error.connected.title = No channel
commands.music.bass.error.connected.description = You have to be in the same voice channel as the bot to change the bass level.
commands.music.bass.help.description = Change the bass for the song which is played at the moment.
commands.music.join.success.title = Successfully connected
commands.music.join.success.description = I successfully connected to %extra%.
commands.music.join.error.connecting.already.title = Already connected

View file

@ -174,6 +174,9 @@ commands.moderation.editrules.success.title = Successfully changed
commands.moderation.editrules.success.description = I successfully changed the rules
commands.moderation.editrules.help.description = Edits the rules message.
commands.music.bass.error.connected.title = No channel
commands.music.bass.error.connected.description = You have to be in the same voice channel as the bot to change the bass level.
commands.music.bass.help.description = Change the bass for the song which is played at the moment.
commands.music.join.success.title = Successfully connected
commands.music.join.success.description = I successfully connected to %extra%.
commands.music.join.error.connecting.already.title = Already connected

View file

@ -174,6 +174,9 @@ commands.moderation.editrules.success.title = Successfully changed
commands.moderation.editrules.success.description = I successfully changed the rules
commands.moderation.editrules.help.description = Edits the rules message.
commands.music.bass.error.connected.title = No channel
commands.music.bass.error.connected.description = You have to be in the same voice channel as the bot to change the bass level.
commands.music.bass.help.description = Change the bass for the song which is played at the moment.
commands.music.join.success.title = Successfully connected
commands.music.join.success.description = I successfully connected to %extra%.
commands.music.join.error.connecting.already.title = Already connected

View file

@ -174,6 +174,9 @@ commands.moderation.editrules.success.title = Successfully changed
commands.moderation.editrules.success.description = I successfully changed the rules
commands.moderation.editrules.help.description = Edits the rules message.
commands.music.bass.error.connected.title = No channel
commands.music.bass.error.connected.description = You have to be in the same voice channel as the bot to change the bass level.
commands.music.bass.help.description = Change the bass for the song which is played at the moment.
commands.music.join.success.title = Successfully connected
commands.music.join.success.description = I successfully connected to %extra%.
commands.music.join.error.connecting.already.title = Already connected