Fix Internal error

main
Elnu 1 year ago
parent 5e6bb8f2d0
commit 58dbb425ba

@ -240,7 +240,12 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
if !repost_here && here { if !repost_here && here {
continue; 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") { if !data.contains_key("submissionChannel") {
continue; continue;
} }

Loading…
Cancel
Save