when my bot joins another guild and fires the guildCreate event

24 Replies
space
space3y ago
Empty strings are not valid urls.
SkullGamingHQ
SkullGamingHQOP3y ago
for setThumbnail(${newGuild.iconURL({ dynamic: true }) || ''}) if you dont have an empty string and the guild doesnt have an icon it errors out
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
SkullGamingHQ
SkullGamingHQOP3y ago
hmm maybe theyve changed it in v14, in 13 if you didnt have the empty string it would error out
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
SkullGamingHQ
SkullGamingHQOP3y ago
removed the empty string and now its erroring as null
space
space3y ago
Can you show the new error?
SkullGamingHQ
SkullGamingHQOP3y ago
SourceBin
errorFull
Instantly share your code with the world.
space
space3y ago
Can you show the rest of the error too?
SkullGamingHQ
SkullGamingHQOP3y ago
wouldnt let me upload the error here directly so had to put it on sourcebin
space
space3y ago
This looks like the string 'null' now, which is not null.
SkullGamingHQ
SkullGamingHQOP3y ago
the guild im trying to add it to doesnt have a server icon so i normally added the empty string for the thumbnail
space
space3y ago
You can just remove the fallback and it should work.
SkullGamingHQ
SkullGamingHQOP3y ago
SourceBin
errorFull
Instantly share your code with the world.
space
space3y ago
Can you show the code for that?
SkullGamingHQ
SkullGamingHQOP3y ago
first post, all i did was take out the || '' from the .setThumbnail
space
space3y ago
I don't see how the string 'null' would end up there then. You probably are not running that code then.
SkullGamingHQ
SkullGamingHQOP3y ago
the webhook client at the bottom sends the embed when the guildCreate event is fired
space
space3y ago
Looks like it
SkullGamingHQ
SkullGamingHQOP3y ago
if i take out the .setThumbnail and the iconURL from the footer it works perfectly fine can a webhook send back a guilds icon when it enters a guild?
space
space3y ago
Sure
SkullGamingHQ
SkullGamingHQOP3y ago
im at a loss at why its going null
space
space3y ago
It's not going null, it's 'null'. Oh Now I see it Remove the template literals `` <- Just pass newGuild.iconURL(...)
SkullGamingHQ
SkullGamingHQOP3y ago
oh right cause im not passing the empty string now its now working, thanks for the help

Did you find this page helpful?