|
|
|
@ -20,7 +20,8 @@ use std::path::Path;
|
|
|
|
|
)]
|
|
|
|
|
pub async fn challenge(ctx: Context<'_>) -> Result<(), Error> {
|
|
|
|
|
ctx.say(format!(
|
|
|
|
|
"Tegaki Tuesday #{n}: <https://tegakituesday.com/{n}>",
|
|
|
|
|
"Tegaki Tuesday #{n}: <https://{domain}/{n}>",
|
|
|
|
|
domain = get_domain(),
|
|
|
|
|
n = get_challenge_number()
|
|
|
|
|
))
|
|
|
|
|
.await?;
|
|
|
|
@ -178,7 +179,7 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
set_submission_data(submission_data);
|
|
|
|
|
let mut message = String::new();
|
|
|
|
|
if requires_rebuild {
|
|
|
|
|
let thank_you = &format!("Thank you for submitting! You can view your submission at <https://tegakituesday.com/{}>", challenge_number);
|
|
|
|
|
let thank_you = &format!("Thank you for submitting! You can view your submission at <https://{domain}/{}>", challenge_number, domain = get_domain());
|
|
|
|
|
let mut repost_here = true;
|
|
|
|
|
match ctx {
|
|
|
|
|
Context::Application(_) => message.push_str(thank_you),
|
|
|
|
@ -230,8 +231,9 @@ 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!("New submission to [Tegaki Tuesday #{n}](https://tegakituesday.com/{n})!");
|
|
|
|
|
let mut description = format!("New submission to [Tegaki Tuesday #{n}](https://{domain}/{n})!");
|
|
|
|
|
if !here {
|
|
|
|
|
description.push_str(&if let Some(invite) = invite {
|
|
|
|
|
format!("\nCrossposted from [{}](https://discord.gg/{invite})", guild.name)
|
|
|
|
@ -246,7 +248,7 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
.name(username)
|
|
|
|
|
.url(format!("https://discord.com/users/{}", author.id));
|
|
|
|
|
e.set_author(embed_author);
|
|
|
|
|
e.image(format!("https://tegakituesday.com/{n}/{image}#{timestamp}"));
|
|
|
|
|
e.image(format!("https://{domain}/{n}/{image}#{timestamp}"));
|
|
|
|
|
if let Some(accent_color) = accent_color {
|
|
|
|
|
e.color(accent_color);
|
|
|
|
|
}
|
|
|
|
@ -300,10 +302,11 @@ pub async fn images(ctx: Context<'_>) -> Result<(), Error> {
|
|
|
|
|
));
|
|
|
|
|
for (i, image) in images.iter().enumerate() {
|
|
|
|
|
message.push_str(&format!(
|
|
|
|
|
"({})<https://tegakituesday.com/{}/{}>\n",
|
|
|
|
|
"({})<https://{domain}/{}/{}>\n",
|
|
|
|
|
to_fullwidth(&(i + 1).to_string()),
|
|
|
|
|
challenge_number,
|
|
|
|
|
image
|
|
|
|
|
image,
|
|
|
|
|
domain = get_domain()
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
ctx.say(message).await?;
|
|
|
|
|