## Welcome to RhythmWorks
Please use the [getting started](#getting-started) section for instructions on how to create a bot for RhythmWorks
### Getting Started
#### You will need to create a bot in Discord for this to work. This is not an application you can add from Discord's App Store.
1. Go to the [Discord Development Portal](https://discord.com/developers/applications)
2. Click New Application
3. Give it a name
4. Go to the OAuth2 Section
    - Check mark the "bot" option under "OAuth2 URL Generator"
    ![botselection](images/1.png)
    - Enable the Following Bot Permissions (Next Section)
        - Send Messages
        - Read Message History
        - Connect
        - Speak
    ![permissionsselection](images/2.png)
    - Copy the Generated URL and paste it into your browser
    - This will automatically launch discord and allow you to add the bot to your server
    ![copyURL](images/3.png)
5. Go to the "Bot" Section
    - Click "Reset Token" and copy it 
        * **You will need to save this in a secure place. This current version does not have a save functionality and you will have to type it in every time**
    ![tokenReset](images/4.png)
    - When you start the bot, paste the token into the prompt
6. Enable all three privileged gateway intents
    ![intents](images/5.png)
6. Download Necessary Files
    - Windows:
        - Download [yt-dlp (Windows)](https://git.racooncity.org/brotoskyj/RhythmWorks/src/branch/master/assets/yt-dlp.exe)
    - Linux:
        - Download [yt-dlp (Linux)](https://git.racooncity.org/brotoskyj/RhythmWorks/src/branch/master/assets/yt-dlp)
7. Place these files in the same directory as RhythmWorks
8. Keep the bot running while you want music to play
9. **IMPORTANT - You will need to !stop the currently playing track or wait for the track to finish before you start playing a new song. If you don't, the two tracks will play overtop of each other**

# Other Important Notes
1. In Windows 11, because of smartscreen and their extra security features, if the bot appears to hang once you do !play in discord, you might have to unblock yt-dlp. Right click on the file, click properties, and near the bottom uncheck  the box that says this file came from the internet and is blocked
### Commands

```
!join
```
This will join the bot to your current voice channel

```
!play https://youtube.com/full-url
```
This will play the youtube audio from the URL 

```
!stop
```
Completely stops the bot
```
!pause
```
Pauses the currently playing track
```
!resume
```
Resumes the paused track
```
!leave
```
The bot will leave the channel

### Roadmap

- Add save funtionality for Discord Bot Token

- User Interface for the admin or whoever the person is who started the bot to have a heads up display and be able to control the bot

- [Project Roadmap](https://git.racooncity.org/brotoskyj/RhythmWorks/projects/4)
## License

[AGPLv3](https://choosealicense.com/licenses/agpl-3.0/)

