Fix Internal error

main
Elnu 2 years ago
parent 5e6bb8f2d0
commit 58dbb425ba

@ -240,7 +240,12 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
if !repost_here && here {
continue;
}
let data = data.as_object().unwrap();
let data = match data.as_object() {
Some(data) => data,
// "suggestionChannel": "..." is at root level,
// and is not an object. Ignore it.
None => continue,
};
if !data.contains_key("submissionChannel") {
continue;
}

Loading…
Cancel
Save