mirror of
https://github.com/arthur-pbty/shadowbot.git
synced 2026-06-03 15:07:37 +02:00
e1016e0af1
- Updated `handle_idle`, `handle_invisible`, `handle_online`, `handle_listen`, `handle_playto`, `handle_stream`, `handle_watch`, and `handle_remove_activity` functions to use a unified approach for setting bot status and sending embed messages. - Removed dependency on `botconfig_common` and replaced it with direct database interactions for status management. - Added new helper functions for logging and moderation channel management. - Introduced permission handling improvements in `set` command with better error messages and user feedback. - Created new utility functions for parsing user and role IDs, ensuring better command access control.
19 lines
657 B
Rust
19 lines
657 B
Rust
pub fn parse_color(value: &str) -> Option<u32> {
|
|
let v = value.trim().to_lowercase();
|
|
match v.as_str() {
|
|
"red" | "rouge" => Some(0xED4245),
|
|
"green" | "vert" => Some(0x57F287),
|
|
"blue" | "bleu" => Some(0x5865F2),
|
|
"yellow" | "jaune" => Some(0xFEE75C),
|
|
"orange" => Some(0xFAA61A),
|
|
"purple" | "violet" => Some(0x9B59B6),
|
|
"pink" | "rose" => Some(0xEB459E),
|
|
"white" | "blanc" => Some(0xFFFFFF),
|
|
"black" | "noir" => Some(0x000000),
|
|
_ => {
|
|
let hex = v.trim_start_matches('#').trim_start_matches("0x");
|
|
u32::from_str_radix(hex, 16).ok()
|
|
}
|
|
}
|
|
}
|