create ButtonRaw name, callback_name and literal getters
This commit is contained in:
parent
1730107e9a
commit
178f2a2399
@ -379,6 +379,21 @@ impl ButtonRaw {
|
||||
callback_name: literal,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name(&self) -> &ButtonName {
|
||||
&self.name
|
||||
}
|
||||
|
||||
pub fn callback_name(&self) -> &str {
|
||||
&self.callback_name
|
||||
}
|
||||
|
||||
pub fn literal(&self) -> Option<String> {
|
||||
match self.name() {
|
||||
ButtonName::Value { .. } => None,
|
||||
ButtonName::Literal { literal } => Some(literal.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user