Tentative embed caching fix

late-submissions
Elnu 2 years ago
parent 83790e91c2
commit c10853f5d1

@ -204,6 +204,7 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
Some(data["invite"].as_str().unwrap()) Some(data["invite"].as_str().unwrap())
} else { } else {
None }; None };
let timestamp = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_millis();
for image in submitted_images.iter() { for image in submitted_images.iter() {
for (other_guild_id, data) in guild_data.iter() { for (other_guild_id, data) in guild_data.iter() {
let here = other_guild_id.eq(&ctx.guild_id().unwrap().as_u64().to_string()); let here = other_guild_id.eq(&ctx.guild_id().unwrap().as_u64().to_string());
@ -247,7 +248,7 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
.name(username) .name(username)
.url(format!("https://discord.com/users/{}", author.id)); .url(format!("https://discord.com/users/{}", author.id));
e.set_author(embed_author); e.set_author(embed_author);
e.image(format!("https://tegakituesday.com/{n}/{image}")); e.image(format!("https://tegakituesday.com/{n}/{image}#{timestamp}"));
if let Some(accent_color) = accent_color { if let Some(accent_color) = accent_color {
e.color(accent_color); e.color(accent_color);
} }

Loading…
Cancel
Save