added check for guild only commands

This commit is contained in:
2021-11-13 22:30:18 +00:00
parent 5230101a8d
commit ebd1efa990
5 changed files with 27 additions and 4 deletions

View File

@ -48,7 +48,9 @@ impl ComponentDataModel {
}
pub fn from_custom_id(data: &String) -> Self {
let buf = base64::decode(data).unwrap();
let buf = base64::decode(data)
.map_err(|e| format!("Could not decode `custom_id' {}: {:?}", data, e))
.unwrap();
let cur = Cursor::new(buf);
rmp_serde::from_read(cur).unwrap()
}