|
|
@ -125,13 +125,14 @@ async fn submit(ctx: &Context, msg: &Message) -> CommandResult {
|
|
|
|
// there are large duplicated sections that need to be merged somehow.
|
|
|
|
// there are large duplicated sections that need to be merged somehow.
|
|
|
|
let guild_data = get_guild_data();
|
|
|
|
let guild_data = get_guild_data();
|
|
|
|
let guild = msg.guild_id.unwrap().as_u64().to_string();
|
|
|
|
let guild = msg.guild_id.unwrap().as_u64().to_string();
|
|
|
|
if !guild_data.contains_key(&guild) {
|
|
|
|
let current_guild_data = &guild_data[&guild].as_object().unwrap();
|
|
|
|
|
|
|
|
if !guild_data.contains_key(&guild) || !current_guild_data.contains_key("submissionChannel") {
|
|
|
|
msg.reply(&ctx.http, "Submissions aren't enabled for this server yet.").await?;
|
|
|
|
msg.reply(&ctx.http, "Submissions aren't enabled for this server yet.").await?;
|
|
|
|
return Ok(());
|
|
|
|
return Ok(());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let submission_channel = &guild_data[&guild].as_object().unwrap()["submissionChannel"].as_str().unwrap();
|
|
|
|
let submission_channel = current_guild_data["submissionChannel"].as_str().unwrap();
|
|
|
|
if submission_channel != &msg.channel_id.as_u64().to_string() {
|
|
|
|
if submission_channel != &msg.channel_id.as_u64().to_string() {
|
|
|
|
msg.reply(&ctx.http, format!("Sorry, submissions aren't permitted here. Please go to <#{}>. Thanks!", submission_channel)).await?;
|
|
|
|
msg.reply(&ctx.http, format!("Sorry, submissions aren't permitted here. Please go to <#{}>. Thanks!", guild)).await?;
|
|
|
|
return Ok(());
|
|
|
|
return Ok(());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msg.attachments.len() == 0 {
|
|
|
|
if msg.attachments.len() == 0 {
|
|
|
|