|
|
|
@ -42,7 +42,7 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
Context::Prefix(ctx) => {
|
|
|
|
|
if ctx.msg.attachments.len() == 0 {
|
|
|
|
|
ctx.msg
|
|
|
|
|
.reply(&ctx.discord.http, "Please attach at least one image.")
|
|
|
|
|
.reply(&ctx.serenity_context.http, "Please attach at least one image.")
|
|
|
|
|
.await?;
|
|
|
|
|
return Ok(());
|
|
|
|
|
}
|
|
|
|
@ -182,7 +182,7 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
let mut repost_here = true;
|
|
|
|
|
match ctx {
|
|
|
|
|
Context::Application(_) => message.push_str(thank_you),
|
|
|
|
|
Context::Prefix(ctx) => match ctx.msg.delete(&ctx.discord.http).await {
|
|
|
|
|
Context::Prefix(ctx) => match ctx.msg.delete(&ctx.serenity_context.http).await {
|
|
|
|
|
Ok(_) => {}
|
|
|
|
|
// don't repost image on this server if no manage messages perm
|
|
|
|
|
// (if we can't delete user's image it'll be displayed twice)
|
|
|
|
@ -221,13 +221,13 @@ pub async fn submit(ctx: Context<'_>, submission: serenity::Attachment) -> Resul
|
|
|
|
|
.unwrap(),
|
|
|
|
|
);
|
|
|
|
|
let accent_color = ctx
|
|
|
|
|
.discord()
|
|
|
|
|
.serenity_context()
|
|
|
|
|
.http
|
|
|
|
|
.get_user(*author.id.as_u64())
|
|
|
|
|
.await
|
|
|
|
|
.unwrap()
|
|
|
|
|
.accent_colour;
|
|
|
|
|
channel.send_message(&ctx.discord().http, |m| {
|
|
|
|
|
channel.send_message(&ctx.serenity_context().http, |m| {
|
|
|
|
|
m.embed(|e| {
|
|
|
|
|
let username = format!("{}#{}", author.name, author.discriminator);
|
|
|
|
|
let n = get_challenge_number();
|
|
|
|
@ -411,14 +411,14 @@ pub async fn suggest(
|
|
|
|
|
// If we just do msg.author.accent_colour here, we will get None
|
|
|
|
|
let author = &ctx.author();
|
|
|
|
|
let accent_color = ctx
|
|
|
|
|
.discord()
|
|
|
|
|
.serenity_context()
|
|
|
|
|
.http
|
|
|
|
|
.get_user(*author.id.as_u64())
|
|
|
|
|
.await
|
|
|
|
|
.unwrap()
|
|
|
|
|
.accent_colour;
|
|
|
|
|
channel
|
|
|
|
|
.send_message(&ctx.discord().http, |m| {
|
|
|
|
|
.send_message(&ctx.serenity_context().http, |m| {
|
|
|
|
|
m.allowed_mentions(|am| {
|
|
|
|
|
am.empty_parse();
|
|
|
|
|
am
|
|
|
|
|