mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
fix(Guild): add invite manager property, extend CachedManager (#6049)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const BaseManager = require('./BaseManager');
|
const CachedManager = require('./CachedManager');
|
||||||
const { Error } = require('../errors');
|
const { Error } = require('../errors');
|
||||||
const Invite = require('../structures/Invite');
|
const Invite = require('../structures/Invite');
|
||||||
const Collection = require('../util/Collection');
|
const Collection = require('../util/Collection');
|
||||||
@@ -8,11 +8,11 @@ const DataResolver = require('../util/DataResolver');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages API methods for GuildInvites and stores their cache.
|
* Manages API methods for GuildInvites and stores their cache.
|
||||||
* @extends {BaseManager}
|
* @extends {CachedManager}
|
||||||
*/
|
*/
|
||||||
class GuildInviteManager extends BaseManager {
|
class GuildInviteManager extends CachedManager {
|
||||||
constructor(guild, iterable) {
|
constructor(guild, iterable) {
|
||||||
super(guild.client, iterable, Invite);
|
super(guild.client, Invite, iterable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The guild this Manager belongs to
|
* The guild this Manager belongs to
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const GuildApplicationCommandManager = require('../managers/GuildApplicationComm
|
|||||||
const GuildBanManager = require('../managers/GuildBanManager');
|
const GuildBanManager = require('../managers/GuildBanManager');
|
||||||
const GuildChannelManager = require('../managers/GuildChannelManager');
|
const GuildChannelManager = require('../managers/GuildChannelManager');
|
||||||
const GuildEmojiManager = require('../managers/GuildEmojiManager');
|
const GuildEmojiManager = require('../managers/GuildEmojiManager');
|
||||||
|
const GuildInviteManager = require('../managers/GuildInviteManager');
|
||||||
const GuildMemberManager = require('../managers/GuildMemberManager');
|
const GuildMemberManager = require('../managers/GuildMemberManager');
|
||||||
const PresenceManager = require('../managers/PresenceManager');
|
const PresenceManager = require('../managers/PresenceManager');
|
||||||
const RoleManager = require('../managers/RoleManager');
|
const RoleManager = require('../managers/RoleManager');
|
||||||
@@ -90,6 +91,12 @@ class Guild extends AnonymousGuild {
|
|||||||
*/
|
*/
|
||||||
this.stageInstances = new StageInstanceManager(this);
|
this.stageInstances = new StageInstanceManager(this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A manager of the invites of this guild
|
||||||
|
* @type {GuildInviteManager}
|
||||||
|
*/
|
||||||
|
this.invites = new GuildInviteManager(this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the bot has been removed from the guild
|
* Whether the bot has been removed from the guild
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -859,7 +859,6 @@ declare module 'discord.js' {
|
|||||||
public approximatePresenceCount: number | null;
|
public approximatePresenceCount: number | null;
|
||||||
public available: boolean;
|
public available: boolean;
|
||||||
public bans: GuildBanManager;
|
public bans: GuildBanManager;
|
||||||
public invites: GuildInviteManager;
|
|
||||||
public channels: GuildChannelManager;
|
public channels: GuildChannelManager;
|
||||||
public commands: GuildApplicationCommandManager;
|
public commands: GuildApplicationCommandManager;
|
||||||
public defaultMessageNotifications: DefaultMessageNotificationLevel | number;
|
public defaultMessageNotifications: DefaultMessageNotificationLevel | number;
|
||||||
@@ -867,6 +866,7 @@ declare module 'discord.js' {
|
|||||||
public discoverySplash: string | null;
|
public discoverySplash: string | null;
|
||||||
public emojis: GuildEmojiManager;
|
public emojis: GuildEmojiManager;
|
||||||
public explicitContentFilter: ExplicitContentFilterLevel;
|
public explicitContentFilter: ExplicitContentFilterLevel;
|
||||||
|
public invites: GuildInviteManager;
|
||||||
public readonly joinedAt: Date;
|
public readonly joinedAt: Date;
|
||||||
public joinedTimestamp: number;
|
public joinedTimestamp: number;
|
||||||
public large: boolean;
|
public large: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user