From 06cbc51c0eea890744bda1aca2c80ca6e43a12d1 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sun, 18 Jul 2021 16:27:55 +0900 Subject: [PATCH] Use multiple aliases --- youmubot/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youmubot/src/main.rs b/youmubot/src/main.rs index 92ea3d9..d204cd8 100644 --- a/youmubot/src/main.rs +++ b/youmubot/src/main.rs @@ -172,7 +172,11 @@ async fn setup_framework(token: &str) -> StandardFramework { let fw = StandardFramework::new() .configure(|c| { c.with_whitespace(false) - .prefix(&var("PREFIX").unwrap_or_else(|_| "y!".to_owned())) + .prefixes( + var("PREFIX") + .map(|v| v.split(",").map(|v| v.trim().to_owned()).collect()) + .unwrap_or_else(|_| vec!["y!".to_owned(), "y2!".to_owned()]), + ) .delimiters(vec![" / ", "/ ", " /", "/"]) .owners([owner.id].iter().cloned().collect()) })