bumped to rc.7. embed avatar inside executable. nudge now outputs the current nudge when ran with no arguments

This commit is contained in:
2020-10-23 22:23:43 +01:00
parent 50fb28d226
commit 8e567bf10b
5 changed files with 38 additions and 40 deletions

View File

@ -6,12 +6,10 @@ pub const CHARACTERS: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX
const THEME_COLOR_FALLBACK: u32 = 0x8fb677;
use std::{collections::HashSet, env, iter::FromIterator, path::Path};
use std::{collections::HashSet, env, iter::FromIterator};
use regex::Regex;
use log::warn;
lazy_static! {
pub static ref SUBSCRIPTION_ROLES: HashSet<u64> = HashSet::from_iter(
env::var("SUBSCRIPTION_ROLES")
@ -55,18 +53,4 @@ lazy_static! {
THEME_COLOR_FALLBACK,
|inner| u32::from_str_radix(&inner, 16).unwrap_or(THEME_COLOR_FALLBACK)
);
pub static ref WEBHOOK_AVATAR: Option<String> = env::var("WEBHOOK_AVATAR")
.ok()
.map(|s| {
let p = Path::new(&s);
if !p.exists() {
warn!("WEBHOOK_AVATAR path doesn't exist. Falling back");
None
} else {
Some(s)
}
})
.flatten();
}