From 8fad7e71b6f9756018212a5bfcb21977d062b441 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 27 Mar 2023 02:42:46 +0200 Subject: [PATCH] feat: add thumbnail and footer to interaction response embed --- src/utils/poll.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/utils/poll.rs b/src/utils/poll.rs index d23d4cf..f0873f1 100644 --- a/src/utils/poll.rs +++ b/src/utils/poll.rs @@ -1,6 +1,5 @@ -use poise::serenity_prelude::{ButtonStyle, ReactionType, Timestamp}; - use base64::Engine; +use poise::serenity_prelude::{ButtonStyle, ReactionType, Timestamp}; use reqwest::StatusCode; use tracing::log::{error, trace}; @@ -44,6 +43,14 @@ pub async fn handle_poll( Err("You are not eligible to vote on this poll.") }; + let icon_url = component + .guild_id + .unwrap() + .to_guild_cached(&ctx.cache) + .unwrap() + .icon_url() + .unwrap(); + component .create_interaction_response(&ctx.http, |r| { r.interaction_response_data(|m| { @@ -71,7 +78,11 @@ pub async fn handle_poll( Err(msg) => e.title("Error").description(msg), } .color(data.configuration.general.embed_color) - .thumbnail(member.user.face()) + .thumbnail(&icon_url) + .footer(|f| { + f.text("ReVanced"); + f.icon_url(&icon_url) + }) }) }) })