Fix some stuff
This commit is contained in:
parent
e40a59fe14
commit
4c4389b392
5 changed files with 10 additions and 82 deletions
|
|
@ -99,7 +99,6 @@ public class Hadder {
|
||||||
new AvatarCommand(),
|
new AvatarCommand(),
|
||||||
new EvalCommand(),
|
new EvalCommand(),
|
||||||
new JoinCommand(),
|
new JoinCommand(),
|
||||||
new LeaveCommand(),
|
|
||||||
new GuildLeaveCommand(),
|
new GuildLeaveCommand(),
|
||||||
new MemeCommand(),
|
new MemeCommand(),
|
||||||
new InviteDetectCommand(),
|
new InviteDetectCommand(),
|
||||||
|
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2019-2020 GregTCLTK and Schlauer-Hax
|
|
||||||
*
|
|
||||||
* Licensed under the GNU Affero General Public License, Version 3.0;
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.bbn.hadder.commands.music;
|
|
||||||
|
|
||||||
import com.bbn.hadder.commands.Command;
|
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
|
||||||
|
|
||||||
public class LeaveCommand implements Command {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void executed(String[] args, CommandEvent e) {
|
|
||||||
if (e.getGuild().getSelfMember().getVoiceState().inVoiceChannel()) {
|
|
||||||
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
|
||||||
e.getGuild().getAudioManager().closeAudioConnection();
|
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
|
||||||
MessageEditor.MessageType.INFO,
|
|
||||||
"commands.music.leave.success.title",
|
|
||||||
"commands.music.leave.success.description")
|
|
||||||
.build()).queue();
|
|
||||||
} else {
|
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
|
||||||
"commands.music.leave.error.channel.title",
|
|
||||||
"commands.music.leave.error.channel.description")
|
|
||||||
.build()).queue();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(
|
|
||||||
MessageEditor.MessageType.ERROR,
|
|
||||||
"commands.music.leave.error.connected.tile",
|
|
||||||
"commands.music.leave.error.connected.description")
|
|
||||||
.build()).queue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] labels() {
|
|
||||||
return new String[]{"leave", "quit"};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String description() {
|
|
||||||
return "commands.music.leave.help.description";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String usage() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String example() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -26,10 +26,14 @@ public class SkipCommand implements Command {
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (e.getAudioManager().hasPlayer(e.getGuild()) && !e.getAudioManager().getTrackManager(e.getGuild()).getQueuedTracks().isEmpty()) {
|
if (e.getAudioManager().hasPlayer(e.getGuild()) && !e.getAudioManager().getTrackManager(e.getGuild()).getQueuedTracks().isEmpty()) {
|
||||||
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
||||||
e.getAudioManager().forceSkipTrack(e);
|
if (!e.getAudioManager().getTrackManager(e.getGuild()).isLoop()) {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
e.getAudioManager().forceSkipTrack(e);
|
||||||
"commands.music.skip.success.title",
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
|
||||||
"commands.music.skip.success.description").build()).queue();
|
"commands.music.skip.success.title",
|
||||||
|
"commands.music.skip.success.description").build()).queue();
|
||||||
|
} else {
|
||||||
|
e.getTextChannel().sendMessage("Get rekt lol Mach Loop aus noob").queue();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
|
||||||
"commands.music.skip.error.connected.title",
|
"commands.music.skip.error.connected.title",
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ public class StopCommand implements Command {
|
||||||
public void executed(String[] args, CommandEvent e) {
|
public void executed(String[] args, CommandEvent e) {
|
||||||
if (e.getAudioManager().hasPlayer(e.getGuild()) && e.getAudioManager().getPlayer(e.getGuild()).getPlayingTrack() != null) {
|
if (e.getAudioManager().hasPlayer(e.getGuild()) && e.getAudioManager().getPlayer(e.getGuild()).getPlayingTrack() != null) {
|
||||||
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
||||||
|
e.getAudioManager().getTrackManager(e.getGuild()).setLoop(false);
|
||||||
e.getAudioManager().players.remove(e.getGuild().getId());
|
e.getAudioManager().players.remove(e.getGuild().getId());
|
||||||
e.getAudioManager().getPlayer(e.getGuild()).destroy();
|
e.getAudioManager().getPlayer(e.getGuild()).destroy();
|
||||||
e.getAudioManager().getTrackManager(e.getGuild()).purgeQueue();
|
e.getAudioManager().getTrackManager(e.getGuild()).purgeQueue();
|
||||||
|
|
@ -48,7 +49,7 @@ public class StopCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] labels() {
|
public String[] labels() {
|
||||||
return new String[]{"stop"};
|
return new String[]{"stop", "leave"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -223,13 +223,6 @@ commands.music.join.error.channel.description = You aren't in a Voice Channel.
|
||||||
commands.music.join.error.permission.title = No permission
|
commands.music.join.error.permission.title = No permission
|
||||||
commands.music.join.error.permission.description = I am not allowed to join your voice channel.
|
commands.music.join.error.permission.description = I am not allowed to join your voice channel.
|
||||||
commands.music.join.help.description = Joins your voice channel.
|
commands.music.join.help.description = Joins your voice channel.
|
||||||
commands.music.leave.success.title = Successfully disconnected
|
|
||||||
commands.music.leave.success.description = I successfully disconnected from the Voice Channel
|
|
||||||
commands.music.leave.error.channel.title = No channel
|
|
||||||
commands.music.leave.error.channel.description = You have to be in the same voice channel as the bot.
|
|
||||||
commands.music.leave.error.connected.tile = Not connected
|
|
||||||
commands.music.leave.error.connected.description = I'm currently in no Voice Channel on this Guild
|
|
||||||
commands.music.leave.help.description = Leaves your voice channel.
|
|
||||||
commands.music.play.load.title = %extra% Now loading %extra%
|
commands.music.play.load.title = %extra% Now loading %extra%
|
||||||
commands.music.play.load.description = Trying to load the song...
|
commands.music.play.load.description = Trying to load the song...
|
||||||
commands.music.play.success.loading.title = %extra% Now playing %extra%
|
commands.music.play.success.loading.title = %extra% Now playing %extra%
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue