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