diff options
| author | seth <[email protected]> | 2023-11-30 22:44:26 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-01 07:12:49 -0500 |
| commit | 41dfa94258215769b9d844875e79097d4a498770 (patch) | |
| tree | 5fb5a42545477ea1958ca6e5a1c1ae9b8d4899f7 /src/utils.rs | |
| parent | 76c0f94e6d7aa108424b34826eb7d8514b026287 (diff) | |
refactor: expand Settings
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/utils.rs b/src/utils.rs index 9a1d09c..c0353f0 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,10 +1,9 @@ -use crate::{colors, consts, Context}; +use crate::{colors, Context}; use color_eyre::eyre::{eyre, Result}; -use once_cell::sync::Lazy; use poise::serenity_prelude as serenity; use rand::seq::SliceRandom; -use serenity::{CreateEmbed, GuildId, Message}; +use serenity::{CreateEmbed, Message}; use url::Url; pub fn parse_snowflake_from_env<T, F: Fn(u64) -> T>(key: &str, f: F) -> Option<T> { @@ -45,15 +44,6 @@ pub fn floor_char_boundary(s: &str, index: usize) -> usize { } } -pub fn is_guild_allowed(gid: GuildId) -> bool { - static ALLOWED_GUILDS: Lazy<Vec<GuildId>> = Lazy::new(|| { - parse_snowflakes_from_env("ALLOWED_GUILDS", GuildId) - .unwrap_or_else(|| vec![consts::TEAWIE_GUILD, GuildId(1091969030694375444)]) - }); - - ALLOWED_GUILDS.contains(&gid) -} - pub async fn send_url_as_embed(ctx: Context<'_>, url: String) -> Result<()> { let parsed = Url::parse(&url)?; |
