fix clippy warnings
This commit is contained in:
parent
71589c3f5d
commit
1e035859fb
10
src/main.rs
10
src/main.rs
@ -1,5 +1,4 @@
|
||||
use poise::serenity_prelude::{self as serenity, GatewayIntents};
|
||||
use dotenv;
|
||||
mod command;
|
||||
|
||||
pub struct Data {} // User data, which is stored and accessible in all command invocations
|
||||
@ -101,10 +100,15 @@ fn read_env() -> BotEnv {
|
||||
dotenv::dotenv().ok();
|
||||
// ==================== ID ===========================
|
||||
let id: String = std::env::var(DISCORD_ID)
|
||||
.expect(&format!("WARN: Missing {DISCORD_ID}\n> This isn't really that problematic, just that the generated invite link won't work."));
|
||||
.unwrap_or_else(|_| {
|
||||
println!(r#"
|
||||
WARN: Missing {DISCORD_ID}
|
||||
> This isn't really that problematic, just that the generated invite link won't work."#);
|
||||
String::from("")
|
||||
});
|
||||
// ==================== Token ========================
|
||||
let token: String = std::env::var(DISCORD_TOKEN)
|
||||
.expect(&format!("ERROR: Missing {DISCORD_TOKEN}"));
|
||||
.unwrap_or_else(|_| panic!("ERROR: Missing {DISCORD_TOKEN}"));
|
||||
// ==================== Intents ======================
|
||||
let intents_env: String = std::env::var(DISCORD_INTENTS)
|
||||
.unwrap_or_else(|msg| {
|
||||
|
Loading…
Reference in New Issue
Block a user