Skip to content

Commit

Permalink
try getting a gif if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Jun 13, 2024
1 parent caeefbf commit e251d68
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/services/gamebridge/payloads/ChatPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,20 @@ export default class ChatPayload extends Payload {
}
} catch {} // dont care

const avatar = msg.author.avatarURL({ forceStatic: true });
const avatarhash = msg.author.avatar;
const avatar = avatarhash
? `https://cdn.discordapp.com/avatars/${msg.author.id}/${avatarhash}${
avatarhash.startsWith("a_") ? ".gif" : ".png"
}`
: msg.author.defaultAvatarURL;

const payload: ChatResponse = {
user: {
id: msg.author.id,
username: username,
nick: nickname,
color: msg.member?.displayColor ?? 0,
avatar_url: avatar ?? msg.author.defaultAvatarURL,
avatar_url: avatar,
},
msgID: msg.id,
content: content,
Expand Down

0 comments on commit e251d68

Please sign in to comment.