Added readme and license
This commit is contained in:
Generated
+15
-15
@@ -2,6 +2,21 @@
|
|||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 4
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "RythmWorks"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"reqwest",
|
||||||
|
"semver",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"serenity",
|
||||||
|
"songbird",
|
||||||
|
"symphonia",
|
||||||
|
"tokio",
|
||||||
|
"yt-dlp",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "adler2"
|
name = "adler2"
|
||||||
version = "2.0.1"
|
version = "2.0.1"
|
||||||
@@ -690,21 +705,6 @@ dependencies = [
|
|||||||
"subtle",
|
"subtle",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "discord_music"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"reqwest",
|
|
||||||
"semver",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"serenity",
|
|
||||||
"songbird",
|
|
||||||
"symphonia",
|
|
||||||
"tokio",
|
|
||||||
"yt-dlp",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "discortp"
|
name = "discortp"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
|
|||||||
+12
-1
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "discord_music"
|
name = "RythmWorks"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
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"] }
|
symphonia = { version = "0.5.5", features = ["aac", "alac", "isomp4", "mp3"] }
|
||||||
tokio = "1.48.0"
|
tokio = "1.48.0"
|
||||||
yt-dlp = "1.4.7"
|
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
|
||||||
|
|||||||
@@ -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
Binary file not shown.
Binary file not shown.
+6
-3
@@ -10,7 +10,7 @@ use songbird::input::HlsRequest;
|
|||||||
use songbird::input::Input;
|
use songbird::input::Input;
|
||||||
use songbird::tracks::TrackHandle;
|
use songbird::tracks::TrackHandle;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::io;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
use std::sync::Arc;
|
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])
|
.args(["-f", "bestaudio", "-g", &url])
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.output()
|
.output()
|
||||||
@@ -160,7 +160,10 @@ async fn main() {
|
|||||||
This program comes with ABSOLUTELY NO WARRANTY\n
|
This program comes with ABSOLUTELY NO WARRANTY\n
|
||||||
This is free software, and you are welcome to redistribute it under certain conditions.");
|
This is free software, and you are welcome to redistribute it under certain conditions.");
|
||||||
updator::update().await;
|
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
|
let intents = GatewayIntents::GUILD_MESSAGES
|
||||||
| GatewayIntents::GUILDS
|
| GatewayIntents::GUILDS
|
||||||
| GatewayIntents::DIRECT_MESSAGES
|
| GatewayIntents::DIRECT_MESSAGES
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
pub mod updator;
|
pub mod updator;
|
||||||
pub mod downloadyt;
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
use std::thread;
|
||||||
|
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
use reqwest;
|
use reqwest;
|
||||||
@@ -12,9 +14,13 @@ pub async fn update() {
|
|||||||
let latest_version = Version::parse(&release_info.tag_name).unwrap();
|
let latest_version = Version::parse(&release_info.tag_name).unwrap();
|
||||||
let current_version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
|
let current_version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
|
||||||
if latest_version > current_version {
|
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 {
|
else {
|
||||||
println!("Already on current version");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user