|
|
|
@ -149,11 +149,17 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let username = if author.discriminator == 0 { // new usernames
|
|
|
|
|
author.name.clone()
|
|
|
|
|
} else {
|
|
|
|
|
format!("{}#{}", author.name, author.discriminator)
|
|
|
|
|
};
|
|
|
|
|
let username = &username;
|
|
|
|
|
if !existing_submitter {
|
|
|
|
|
let mut submitter_data = Map::new();
|
|
|
|
|
submitter_data.insert(
|
|
|
|
|
String::from("username"),
|
|
|
|
|
format!("{}#{}", author.name, author.discriminator).into(),
|
|
|
|
|
username.clone().into(),
|
|
|
|
|
);
|
|
|
|
|
let mut images: Vec<String> = Vec::new();
|
|
|
|
|
for (i, attachment) in attachments.iter().enumerate() {
|
|
|
|
@ -173,10 +179,9 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
}
|
|
|
|
|
requires_rebuild = true;
|
|
|
|
|
let file_name = format!(
|
|
|
|
|
"{}-{}-{}-{}{}.{}",
|
|
|
|
|
"{}-{}-{}{}.{}",
|
|
|
|
|
submission_data.len() + 1,
|
|
|
|
|
slugify(&author.name),
|
|
|
|
|
author.discriminator,
|
|
|
|
|
timestamp,
|
|
|
|
|
if i == 0 {
|
|
|
|
|
"".to_owned()
|
|
|
|
@ -256,7 +261,6 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
channel
|
|
|
|
|
.send_message(&ctx.serenity_context().http, |m| {
|
|
|
|
|
m.embed(|e| {
|
|
|
|
|
let username = format!("{}#{}", author.name, author.discriminator);
|
|
|
|
|
let domain = get_domain();
|
|
|
|
|
let n = get_challenge_number();
|
|
|
|
|
let mut description = format!(
|
|
|
|
|