name fetching errors

client.on("guildUpdate", async (oldGuild, newGuild) => {
const guildd = client.guilds.cache.find(guild => guild.name === oldGuild.vanityURLCode);
await guildd.setVanityURL(oldGuild.vanityURLCode).catch();
client.on("guildUpdate", async (oldGuild, newGuild) => {
const guildd = client.guilds.cache.find(guild => guild.name === oldGuild.vanityURLCode);
await guildd.setVanityURL(oldGuild.vanityURLCode).catch();
im trying to fetching updated oldguild name but getting some errors
if (fn(val, key, this))

TypeError: fn is not a functionif (fn(val, key, this))
^
TypeError: fn is not a function

TypeError: Cannot read properties of undefined (reading 'setVanityURL')
if (fn(val, key, this))

TypeError: fn is not a functionif (fn(val, key, this))
^
TypeError: fn is not a function

TypeError: Cannot read properties of undefined (reading 'setVanityURL')
my purpose after any guildUpdate change vanity url for old guild vanity url code name server example updated guild vanity-url is Testing my purpose change get old vanity url my server but my servername (Testing) oldGuild.VanityUrlCode how to fix error im tried {oldguild.VanityUrlcode} and etc not work i need only fix error i dont need change code i know change some codes but need I need the state I mentioned I hope you understand
9 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Kevinnnn
Kevinnnn5mo ago
guildd is undefined, probably because it couldnt find a guild that has the same name as that vanity url code
offline
offline5mo ago
dcjs 11.6
Harnes
Harnes5mo ago
djs v11 is old and deprecated for a long time, use v14
offline
offline5mo ago
@🌈 Kevinnnn 💐 thanks for helping my problem is finding error updated guild old vanity code name same name guild fetching im changing guild.name === oldGuild.VanityURLCode to === 'test123' working but i need updates servernoldvanity server name and im trying oldguild.VanityURLCode but not working i need add {} $ "" `` or any? note im tried v13 but same errors sry for bad englsh im tried v13 but same error im entering wrong code plz check and help me 😦 im FeelsBadMan
Harnes
Harnes5mo ago
v11 is deprecated and does not supported anymore so no support with that
offline
offline5mo ago
im tried same code on dcjs v12 and v13 but getting same errors dcjs version not effect my code directly my code wrong help me OMEGAlul
offline
offline5mo ago
No description
Koy
Koy5mo ago
well that is against tos