aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Kohls <mattkohls13@gmail.com>2018-04-14 15:33:33 -0400
committerMatt Kohls <mattkohls13@gmail.com>2018-04-14 15:33:33 -0400
commit780705840a868f0b776c9f18832996ea67e70aa3 (patch)
tree3631ae0fa51799a5332fdf4d404bda5709484266
parentf8fe02e835c6417a54033b30a66c9c3bc2097836 (diff)
downloadSoundChan-780705840a868f0b776c9f18832996ea67e70aa3.tar.gz
SoundChan-780705840a868f0b776c9f18832996ea67e70aa3.tar.bz2
SoundChan-780705840a868f0b776c9f18832996ea67e70aa3.zip
Help Command
Adding ~help command so people can find out what the bot can do
-rw-r--r--src/main/java/soundchan/BotListener.java21
-rw-r--r--src/main/java/soundchan/Commands.java3
2 files changed, 23 insertions, 1 deletions
diff --git a/src/main/java/soundchan/BotListener.java b/src/main/java/soundchan/BotListener.java
index 8785892..02170af 100644
--- a/src/main/java/soundchan/BotListener.java
+++ b/src/main/java/soundchan/BotListener.java
@@ -15,6 +15,7 @@ import net.dv8tion.jda.core.events.guild.voice.GuildVoiceMoveEvent;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import net.dv8tion.jda.core.hooks.ListenerAdapter;
import net.dv8tion.jda.core.managers.AudioManager;
+import net.dv8tion.jda.core.managers.ChannelManager;
import java.util.HashMap;
import java.util.List;
@@ -143,6 +144,10 @@ public class BotListener extends ListenerAdapter{
connectToUserVoiceChannel(guild.getAudioManager(), event.getMember().getEffectiveName());
break;
}
+ case help: {
+ help(channel);
+ break;
+ }
}
}
@@ -237,6 +242,22 @@ public class BotListener extends ListenerAdapter{
channel.sendMessage("Skipped to next track.").queue();
}
+ private void help(final MessageChannel channel) {
+ String printMessage = "List of commands:\n ```" +
+ "!<sound> - plays a sound\n" +
+ "~play <URL> - plays audio from link\n" +
+ "~volume # - sets the volume to the number as a percentage \n" +
+ "~pause - pauses the playing audio\n" +
+ "~unpause - unpauses the audio\n" +
+ "~skip - skips to the next song in queue\n" +
+ "~list queue - prints out the names of the songs in the queue\n" +
+ "~list sounds - prints out the names of the sounds available\n" +
+ "~playingnow - prints out the name of the currently playing song\n" +
+ "~summon - brings SoundChan to the voice channel of the summoner\n" +
+ "~help - prints out this help message ```";
+ channel.sendMessage(printMessage).queue();
+ }
+
private static void connectToFollowingVoiceChannel(AudioManager audioManager) {
if(!audioManager.isConnected()) {
diff --git a/src/main/java/soundchan/Commands.java b/src/main/java/soundchan/Commands.java
index 45fda7a..e6ccf0e 100644
--- a/src/main/java/soundchan/Commands.java
+++ b/src/main/java/soundchan/Commands.java
@@ -11,5 +11,6 @@ public enum Commands {
skip,
list,
playingnow,
- summon
+ summon,
+ help
}