Update studio command to use user's avatar if available
Adjusted the studio command to prioritize a user-provided avatar URL over the default Discord avatar for the thumbnail. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 7adfec35-bf1a-43d4-8684-6b0a761dd323 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/7aeQEfK Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
e822e5c8da
commit
b30707143e
3 changed files with 9 additions and 1 deletions
4
.replit
4
.replit
|
|
@ -22,6 +22,10 @@ externalPort = 80
|
||||||
localPort = 8080
|
localPort = 8080
|
||||||
externalPort = 8080
|
externalPort = 8080
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 33401
|
||||||
|
externalPort = 3000
|
||||||
|
|
||||||
[workflows]
|
[workflows]
|
||||||
runButton = "Project"
|
runButton = "Project"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,14 @@ module.exports = {
|
||||||
.order('created_at', { ascending: false })
|
.order('created_at', { ascending: false })
|
||||||
.limit(5);
|
.limit(5);
|
||||||
|
|
||||||
|
const avatarUrl = profile?.avatar_url && profile.avatar_url.startsWith('http')
|
||||||
|
? profile.avatar_url
|
||||||
|
: target.displayAvatarURL();
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setColor(0x7c3aed)
|
.setColor(0x7c3aed)
|
||||||
.setTitle(`${profile?.username || target.tag}'s Studio`)
|
.setTitle(`${profile?.username || target.tag}'s Studio`)
|
||||||
.setThumbnail(profile?.avatar_url || target.displayAvatarURL())
|
.setThumbnail(avatarUrl)
|
||||||
.setDescription(profile?.bio || 'No bio set')
|
.setDescription(profile?.bio || 'No bio set')
|
||||||
.addFields(
|
.addFields(
|
||||||
{ name: 'Total Projects', value: `${projectCount || 0}`, inline: true }
|
{ name: 'Total Projects', value: `${projectCount || 0}`, inline: true }
|
||||||
|
|
|
||||||
BIN
attached_assets/image_1765213694126.png
Normal file
BIN
attached_assets/image_1765213694126.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Loading…
Reference in a new issue