Skip to content

Commit

Permalink
Add youtu.be as a default domain (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmgb authored Jul 12, 2024
1 parent fcf9338 commit a6c1e88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/guild/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
use crate::errors::ParrotError;

const DEFAULT_SETTINGS_PATH: &str = "data/settings";
const DEFAULT_ALLOWED_DOMAINS: [&str; 1] = ["youtube.com"];
const DEFAULT_ALLOWED_DOMAINS: [&str; 2] = ["youtube.com", "youtu.be"];

lazy_static! {
static ref SETTINGS_PATH: String =
Expand Down Expand Up @@ -103,7 +103,11 @@ impl GuildSettings {
}

if self.allowed_domains.is_empty() && self.banned_domains.is_empty() {
self.allowed_domains.insert(String::from("youtube.com"));
self.allowed_domains = DEFAULT_ALLOWED_DOMAINS
.iter()
.map(|d| d.to_string())
.collect();

self.banned_domains.clear();
}
}
Expand Down

0 comments on commit a6c1e88

Please sign in to comment.