From 6ffac3806e3369649ae26a7c9a58baaf52c35829 Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Sun, 1 Jul 2018 20:32:23 -0400 Subject: Adding in user/sound relation from a file You can now have a file with all the users and the intro sound to play without having to have multiple copies of the same sound --- usersound.properties.example | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 usersound.properties.example (limited to 'usersound.properties.example') diff --git a/usersound.properties.example b/usersound.properties.example new file mode 100644 index 0000000..9575f01 --- /dev/null +++ b/usersound.properties.example @@ -0,0 +1,4 @@ +//Here we can map a user to a sound file, so many users can share the same intro soundbite and/or so you don't have to have extra copies of the same sound file + +//Discord user and the file (with extension) +Queen=WeAreTheChampions.mp3 -- cgit v1.2.3 From 296d1b7c87c5497425f6b46070f46bf4caa22ad1 Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Fri, 6 Jul 2018 20:57:14 -0400 Subject: Breaking out properties loading and adding comments --- src/main/java/soundchan/BotListener/BotListener.java | 8 ++++++++ usersound.properties.example | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'usersound.properties.example') diff --git a/src/main/java/soundchan/BotListener/BotListener.java b/src/main/java/soundchan/BotListener/BotListener.java index cccb39a..7a65f78 100644 --- a/src/main/java/soundchan/BotListener/BotListener.java +++ b/src/main/java/soundchan/BotListener/BotListener.java @@ -44,6 +44,14 @@ public class BotListener extends ListenerAdapter{ AudioSourceManagers.registerRemoteSources(playerManager); AudioSourceManagers.registerLocalSource(playerManager); + loadProperties(properties); + } + + /** + * Loads various properties from config file + * @param properties Object holding the contents of the property file + */ + private void loadProperties(Properties properties) { localFilePath = properties.getProperty("localFilePath"); followingUser = properties.getProperty("followingUser"); String temp = properties.getProperty("audioOnUserJoin"); diff --git a/usersound.properties.example b/usersound.properties.example index 9575f01..248d71c 100644 --- a/usersound.properties.example +++ b/usersound.properties.example @@ -2,3 +2,10 @@ //Discord user and the file (with extension) Queen=WeAreTheChampions.mp3 + +//We can also link to sounds in folders inside the main sound folder +Shrek=More/SmashMouth.wav + +//Map multiple people to same sound +Thing1=sawing_wood.wav +Thing2=sawing_wood.wav -- cgit v1.2.3