Skip to content
Snippets Groups Projects
Unverified Commit 28cf81aa authored by tec's avatar tec
Browse files

Provide default (empty) role react mapping

parent 118c332e
Branches
No related merge requests found
use indexmap::IndexMap;
use serde::Deserialize; use serde::Deserialize;
use serde_yaml; use serde_yaml;
use serenity::model::id; use serenity::model::id;
use indexmap::IndexMap;
use std::fs; use std::fs;
lazy_static! { lazy_static! {
...@@ -49,5 +49,10 @@ pub type ReactRoleMap = IndexMap<String, id::RoleId>; ...@@ -49,5 +49,10 @@ pub type ReactRoleMap = IndexMap<String, id::RoleId>;
#[derive(Debug, Deserialize, Clone)] #[derive(Debug, Deserialize, Clone)]
pub struct ReactionMapping { pub struct ReactionMapping {
pub message: serenity::model::id::MessageId, pub message: serenity::model::id::MessageId,
#[serde(default = "empty_rr_map")]
pub mapping: ReactRoleMap, pub mapping: ReactRoleMap,
} }
fn empty_rr_map() -> ReactRoleMap {
IndexMap::new()
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment