Added readme and license

This commit is contained in:
brotoskyj
2025-12-29 15:39:45 -05:00
parent 2b62bd3683
commit 1512018a4f
9 changed files with 104 additions and 22 deletions
Generated
+15 -15
View File
@@ -2,6 +2,21 @@
# It is not intended for manual editing.
version = 4
[[package]]
name = "RythmWorks"
version = "0.1.0"
dependencies = [
"reqwest",
"semver",
"serde",
"serde_json",
"serenity",
"songbird",
"symphonia",
"tokio",
"yt-dlp",
]
[[package]]
name = "adler2"
version = "2.0.1"
@@ -690,21 +705,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "discord_music"
version = "0.1.0"
dependencies = [
"reqwest",
"semver",
"serde",
"serde_json",
"serenity",
"songbird",
"symphonia",
"tokio",
"yt-dlp",
]
[[package]]
name = "discortp"
version = "0.6.0"
+12 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "discord_music"
name = "RythmWorks"
version = "0.1.0"
edition = "2024"
@@ -13,3 +13,14 @@ songbird = { version = "0.5.0", features = ["builtin-queue", "driver", "serenity
symphonia = { version = "0.5.5", features = ["aac", "alac", "isomp4", "mp3"] }
tokio = "1.48.0"
yt-dlp = "1.4.7"
[profile.release]
opt-level = "z"
lto = "fat"
debug = false
codegen-units = 1
panic = 'abort'
strip = true
debug-assertions = false
overflow-checks = true
+63
View File
@@ -0,0 +1,63 @@
## 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"
- Enable the Following Permissions
- Send Messages
- Read Message History
- Connect
- Speak
- 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
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**
- When you start the bot, paste the token into the prompt
6. Keep the bot running while you want music to play
7. **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**
### 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
## License
[AGPLv3](https://choosealicense.com/licenses/agpl-3.0/)
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+6 -3
View File
@@ -10,7 +10,7 @@ use songbird::input::HlsRequest;
use songbird::input::Input;
use songbird::tracks::TrackHandle;
use std::collections::HashMap;
use std::env;
use std::io;
use std::process::Command;
use std::process::Stdio;
use std::sync::Arc;
@@ -105,7 +105,7 @@ impl EventHandler for Handler {
}
}
};
let output = Command::new("yt-dlp")
let output = Command::new("./assets/yt-dlp")
.args(["-f", "bestaudio", "-g", &url])
.stdout(Stdio::piped())
.output()
@@ -160,7 +160,10 @@ async fn main() {
This program comes with ABSOLUTELY NO WARRANTY\n
This is free software, and you are welcome to redistribute it under certain conditions.");
updator::update().await;
let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
println!("Please paste in your bot token");
let mut input = String::new();
io::stdin().read_line(&mut input).expect("Failed to read line");
let token = input.trim();
let intents = GatewayIntents::GUILD_MESSAGES
| GatewayIntents::GUILDS
| GatewayIntents::DIRECT_MESSAGES
View File
-1
View File
@@ -1,2 +1 @@
pub mod updator;
pub mod downloadyt;
+8 -2
View File
@@ -1,3 +1,5 @@
use std::thread;
use serde::Deserialize;
use semver::Version;
use reqwest;
@@ -12,9 +14,13 @@ pub async fn update() {
let latest_version = Version::parse(&release_info.tag_name).unwrap();
let current_version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
if latest_version > current_version {
println!("Update Available")
println!("Update Available! Please download the latest version");
println!("URL: https://git.racooncity.org/brotoskyj/RhythmWorks/releases");
thread::sleep(std::time::Duration::from_secs(10));
std::process::exit(1);
}
else {
println!("Already on current version");
}
}