From 41dfa94258215769b9d844875e79097d4a498770 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 30 Nov 2023 22:44:26 -0500 Subject: refactor: expand Settings --- src/utils.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/utils.rs') 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>(key: &str, f: F) -> Option { @@ -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> = 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)?; -- cgit v1.2.3