File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/bot/src/features/avatar Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import type { Settings , Translation } from "@dicelette/types" ;
2- import { cleanAvatarUrl } from "@dicelette/utils" ;
2+ import { COMPILED_PATTERNS , cleanAvatarUrl } from "@dicelette/utils" ;
33import * as Djs from "discord.js" ;
44import { getEmbeds } from "messages" ;
55import { allowEdit , fetchAvatarUrl } from "utils" ;
@@ -29,9 +29,10 @@ async function showAvatarEdit(
2929 const embed = getEmbeds ( interaction . message , "user" ) ;
3030 if ( ! embed ) throw new Error ( ul ( "error.embed.notFound" ) ) ;
3131 const jsonEmbed = embed . toJSON ( ) . thumbnail ?. url ;
32- const thumbnail = jsonEmbed
32+ let thumbnail = jsonEmbed
3333 ? cleanAvatarUrl ( jsonEmbed )
3434 : await fetchAvatarUrl ( interaction . guild ! , interaction . user ) ;
35+ if ( thumbnail . match ( COMPILED_PATTERNS . DISCORD_CDN ) ) thumbnail = "" ;
3536 const modal = new Djs . ModalBuilder ( )
3637 . setCustomId ( "editAvatar" )
3738 . setTitle ( ul ( "button.avatar.description" ) )
You can’t perform that action at this time.
0 commit comments