diff --git a/README.md b/README.md index 9e8ead2..e3503ed 100644 --- a/README.md +++ b/README.md @@ -3,26 +3,67 @@ This is a new project undertaken by myself and Bianca, it is in the very early d If you come across some issues feel free to post them in the issues. ### General Setup -To be written. +The installation of the bots packages can be made from npm install when in the same directory as the +package.json file. You must open config.sample.json and insert your bots token, after which you should +rename the file to config.json. +To run the bot: +``` +node index.js +``` ### Node must be version 12! Ubuntu node install: +``` curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs +``` ## COMMAND DOCUMENTATION: ### NOTE: Anything after ! is a command name and the prefix ! is needed to run the command, -the items in <> are the function arguments and anything with OPTIONAL is as it sounds. +the items in <> are the function arguments, () are aliases, and anything with OPTIONAL is as it sounds. +(The prefix can be made to any variable by adjusting the field in config.json) ``` -!play +!play (p) ``` If the person using the command is in a voice channel and the bot has access to that channel it will connect and play the song listed. This is also the command to continue adding songs to the queue, it covers both functions. The bot will auto disconnect when the end of the queue is reached. ``` -!skip +!pause <> (ps) +``` +This will check if the player is playing, and if the person envoking is in the same channel +as the bot. If so it will pause the song indefinetely as of now. (May add auto resume) + +``` +!unpause <> (up) +``` +This will check that the bot is "playing" but paused. It will also check to make sure +the envoker is in the same channel as the bot. If so it will resume the playing of a paused song. + +``` +!skip () ``` If the bot is playing a song it will skip to the next song as long as the person is in the same voice channel as the bot. If there are no songs after the bot will automatically disconnect. The argument can be used to say how many songs to skip. (>=1) +#### Note: Skip is also used to clear out errors. If something happens and the bot freezes or stops playing audio, try using skip to reset it. + +``` +!queue () +``` +The queue command will show the currently playing song and all other songs in an embedded queue. +If the queue is longer than 10 songs it will wrap into multiple pages and a page number argument is +optional to view these additiona pages. (First page is default.) + +``` +!shuffle <> () +``` +If the bot is playing and the envoker is in the same voice channel as the bot, this command +will shuffle all songs in the servers queue. + +### Future: +We are moving towards a stable version of this bot with more error checking/handling and making it less prone to failure. +We soon plan to add a playlist system in which you can store and load playlists into the bots queue. +If you have suggestions for functionality or have found bugs in the system please create an issue and upload your log +file content so we can see the root of the issue. Thank you, Robert and Bianca. \ No newline at end of file diff --git a/commands/ytdltie.js b/commands/ytdltie.js index 64f7fc6..b3ec44b 100644 --- a/commands/ytdltie.js +++ b/commands/ytdltie.js @@ -144,7 +144,7 @@ module.exports = class ytdltie { const server_queue = this.queue.get(message.guild.id); if(!voiceChannel || server_queue.voice_channel != voiceChannel) return message.channel.send("Please join a voice channel first."); if(server_queue.connection.dispatcher.pausedSince) return message.channel.send("Song is already paused!"); // Handle double pause - + server_queue.connection.dispatcher.pause(); message.channel.send("⏸️ Paused the song!"); } @@ -154,7 +154,7 @@ module.exports = class ytdltie { const server_queue = this.queue.get(message.guild.id); if(!voiceChannel || server_queue.voice_channel != voiceChannel) return message.channel.send("Please join a voice channel first."); if(!server_queue.connection.dispatcher.pausedSince) return message.channel.send("No music is currently paused"); // Handle call on unpaused. - + // This is a weird but required work around for the unpause situation on Node version 12 (supposed to be fixed on 14 but we do not want to migrate) server_queue.connection.dispatcher.pause(true); server_queue.connection.dispatcher.resume(); server_queue.connection.dispatcher.resume();