Remove redundant avatar_url code

This commit is contained in:
Aadi Desai 2024-02-01 23:25:53 +00:00
parent fbd6b14b79
commit ba2c820d81
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM
5 changed files with 7 additions and 13 deletions

View file

@ -1,4 +1,4 @@
use crate::{db, verify, ACtx, Error};
use crate::{db, ACtx, Error};
use poise::{
serenity_prelude::{self as serenity, CreateEmbed, CreateMessage},
CreateReply,
@ -31,7 +31,7 @@ pub(crate) async fn nick(
CreateMessage::new().embed(
CreateEmbed::new()
.title("Nick updated")
.thumbnail(u.avatar_url().unwrap_or(verify::AVATAR.to_string()))
.thumbnail(u.face())
.description(u.to_string())
.field("Old Nick", old_nickname, true)
.field("New Nick", nickname, true)

View file

@ -239,9 +239,7 @@ pub(crate) async fn login_6(
&ctx.http,
CreateMessage::new().embed(
CreateEmbed::new()
.thumbnail(
m.user.avatar_url().unwrap_or(super::AVATAR.to_string()),
)
.thumbnail(m.user.face())
.title("Member verified via login")
.description(m.user.to_string())
.field("Fresher", fresher.to_string(), true)

View file

@ -129,7 +129,7 @@ pub(crate) async fn manual_3(
.embed(
CreateEmbed::new()
.title("New verification request from")
.thumbnail(m.user.avatar_url().unwrap_or(super::AVATAR.to_string()))
.thumbnail(m.user.face())
.description(m.user.to_string())
.field("Real Name (To be checked)", &realname, true)
.field("Imperial Shortcode (To be checked", &shortcode, true)
@ -246,9 +246,7 @@ pub(crate) async fn manual_4(
.components(vec![])
.embed(
CreateEmbed::new()
.thumbnail(
user.avatar_url().unwrap_or(super::AVATAR.to_string()),
)
.thumbnail(user.face())
.title("Member verified via manual")
.description(user.to_string())
.field("Fresher", fresher.to_string(), true)
@ -290,7 +288,7 @@ pub(crate) async fn manual_4(
CreateEmbed::new()
.title("Member denied via manual")
.description(user.to_string())
.thumbnail(user.avatar_url().unwrap_or(super::AVATAR.to_string()))
.thumbnail(user.face())
.timestamp(serenity::Timestamp::now()),
),
),

View file

@ -179,7 +179,7 @@ pub(crate) async fn membership_3(
&ctx.http,
CreateMessage::new().embed(
CreateEmbed::new()
.thumbnail(m.user.avatar_url().unwrap_or(super::AVATAR.to_string()))
.thumbnail(m.user.face())
.title("Member verified via membership")
.description(m.user.to_string())
.field("Fresher", fresher.to_string(), true)

View file

@ -13,8 +13,6 @@ pub(crate) use membership::*;
pub(crate) mod manual;
pub(crate) use manual::*;
pub(crate) const AVATAR: &str = "https://cdn.discordapp.com/embed/avatars/0.png";
const INFO_MSG: &str = indoc::indoc! {"
Nano is a Discord bot written with serenity-rs/poise and tokio-rs/axum.