What is the event name for when vanity gets updated?

i tried looking into guildUpdate but it's not there
Solution:
You could fetch the audit log in the guildUpdateEvent Or you could use the auditlog event...
Jump to solution
25 Replies
Favna
Favna2y ago
This is a DiscordJS question, not a Sapphire question. It should be on guildUpdate. You're better off asking this in the DiscordJS server discord.gg/djs
untitled.
untitled.OP2y ago
i'm banned from that server. it's not in guildUpdate though
Favna
Favna2y ago
Maybe you should've behaved better then kekw
untitled.
untitled.OP2y ago
ngl no
Favna
Favna2y ago
there is no other event that it can be on, refer to https://discord.js.org/docs/packages/discord.js/14.14.1/Client:Class
discord.js | Client
The main hub for interacting with the Discord API, and the starting point for any bot.
untitled.
untitled.OP2y ago
i got banned bceuse like uh
Favna
Favna2y ago
"political harassment in support" yes
untitled.
untitled.OP2y ago
wait whast political harrasment? LOL
Favna
Favna2y ago
news flash, all the devs in this server are also staff or proficient (in my particular case) in DJS so we have access to mod logs
untitled.
untitled.OP2y ago
do they have the message log of me politcally harrrasing someone
Favna
Favna2y ago
shrug. Maybe. I couldn't be bothered to look it up though. Anyway lets get back to the topic.
untitled.
untitled.OP2y ago
i tried making it return both old and new guild but i think the newguild doesn't exist
untitled.
untitled.OP2y ago
yep, undefined
import { Listener } from '@sapphire/framework';
import { ActivityType, Guild, type Client } from 'discord.js';

export class guildUpdate extends Listener {
public run(client: Client, guild: Guild, newGuild: Guild) {
console.log(guild)
console.log(newGuild)
}
}
import { Listener } from '@sapphire/framework';
import { ActivityType, Guild, type Client } from 'discord.js';

export class guildUpdate extends Listener {
public run(client: Client, guild: Guild, newGuild: Guild) {
console.log(guild)
console.log(newGuild)
}
}
Favna
Favna2y ago
yeah that's wrong. There is no client as first parameter. Not sure what you're basing that on. The first parameter is the old guild and the second new guild. The match 1:1 with the DJS documentation: https://discord.js.org/docs/packages/discord.js/14.14.1/Client:Class#guildUpdate
discord.js | Client
The main hub for interacting with the Discord API, and the starting point for any bot.
untitled.
untitled.OP2y ago
oh yea
Favna
Favna2y ago
to get access to the client in Sapphire you use this.container.client
untitled.
untitled.OP2y ago
yea can i see who updated the guild?
Favna
Favna2y ago
Nope, Discord API doesn't expose that on that event. But you can use guildAuditLogEntryCreate though as being a separate event you may run into race conditions so better not
untitled.
untitled.OP2y ago
how do wick do it tho they have a system where you update something they strip your roles and stuff if i'm not wrong
Favna
Favna2y ago
idk what bot Wick is
untitled.
untitled.OP2y ago
that one antiraid bot
Favna
Favna2y ago
never heard of it anti raid is also built into Discord anyway so bots for it aren't needed anymore
Solution
KaydaFox
KaydaFox2y ago
You could fetch the audit log in the guildUpdateEvent Or you could use the auditlog event
untitled.
untitled.OP2y ago
will try

Did you find this page helpful?