Added readme and license
This commit is contained in:
+6
-3
@@ -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
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
pub mod updator;
|
||||
pub mod downloadyt;
|
||||
@@ -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");
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user