mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-20 20:04:41 +12:00
feat(Client): add guildAvailable event (#9692)
Co-authored-by: Kyranet <kyradiscord@gmail.com>
This commit is contained in:
parent
2ac8be09a1
commit
67dd30a28a
3 changed files with 11 additions and 0 deletions
|
@ -8,6 +8,13 @@ module.exports = (client, { d: data }, shard) => {
|
|||
if (!guild.available && !data.unavailable) {
|
||||
// A newly available guild
|
||||
guild._patch(data);
|
||||
|
||||
/**
|
||||
* Emitted whenever a guild becomes available.
|
||||
* @event Client#guildAvailable
|
||||
* @param {Guild} guild The guild that became available
|
||||
*/
|
||||
client.emit(Events.GUILD_AVAILABLE, guild);
|
||||
}
|
||||
} else {
|
||||
// A new guild
|
||||
|
|
|
@ -183,6 +183,7 @@ exports.Opcodes = {
|
|||
* * AUTO_MODERATION_RULE_CREATE: autoModerationRuleCreate
|
||||
* * AUTO_MODERATION_RULE_DELETE: autoModerationRuleDelete
|
||||
* * AUTO_MODERATION_RULE_UPDATE: autoModerationRuleUpdate
|
||||
* * GUILD_AVAILABLE: guildAvailable
|
||||
* * GUILD_CREATE: guildCreate
|
||||
* * GUILD_DELETE: guildDelete
|
||||
* * GUILD_UPDATE: guildUpdate
|
||||
|
@ -267,6 +268,7 @@ exports.Events = {
|
|||
AUTO_MODERATION_RULE_CREATE: 'autoModerationRuleCreate',
|
||||
AUTO_MODERATION_RULE_DELETE: 'autoModerationRuleDelete',
|
||||
AUTO_MODERATION_RULE_UPDATE: 'autoModerationRuleUpdate',
|
||||
GUILD_AVAILABLE: 'guildAvailable',
|
||||
GUILD_CREATE: 'guildCreate',
|
||||
GUILD_DELETE: 'guildDelete',
|
||||
GUILD_UPDATE: 'guildUpdate',
|
||||
|
|
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
|
@ -4604,6 +4604,7 @@ export interface ClientEvents extends BaseClientEvents {
|
|||
emojiDelete: [emoji: GuildEmoji];
|
||||
emojiUpdate: [oldEmoji: GuildEmoji, newEmoji: GuildEmoji];
|
||||
error: [error: Error];
|
||||
guildAvailable: [guild: Guild];
|
||||
guildBanAdd: [ban: GuildBan];
|
||||
guildBanRemove: [ban: GuildBan];
|
||||
guildCreate: [guild: Guild];
|
||||
|
@ -4870,6 +4871,7 @@ export interface ConstantsEvents {
|
|||
AUTO_MODERATION_RULE_CREATE: 'autoModerationRuleCreate';
|
||||
AUTO_MODERATION_RULE_DELETE: 'autoModerationRuleDelete';
|
||||
AUTO_MODERATION_RULE_UPDATE: 'autoModerationRuleUpdate';
|
||||
GUILD_AVAILABLE: 'guildAvailable';
|
||||
GUILD_CREATE: 'guildCreate';
|
||||
GUILD_DELETE: 'guildDelete';
|
||||
GUILD_UPDATE: 'guildUpdate';
|
||||
|
|
Loading…
Reference in a new issue