Skip to content

Commit

Permalink
Revert "feat(Invite): add deletable getter (discordjs#3203)"
Browse files Browse the repository at this point in the history
This reverts commit bf767ac.
  • Loading branch information
samsamson33 committed Feb 27, 2020
1 parent 151059e commit c9767d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
13 changes: 0 additions & 13 deletions src/structures/Invite.js
@@ -1,7 +1,6 @@
'use strict';

const { Endpoints } = require('../util/Constants');
const Permissions = require('../util/Permissions');
const Base = require('./Base');

/**
Expand Down Expand Up @@ -92,18 +91,6 @@ class Invite extends Base {
return this.createdTimestamp ? new Date(this.createdTimestamp) : null;
}

/**
* Whether the invite is deletable by the client user
* @type {boolean}
* @readonly
*/
get deletable() {
const guild = this.guild;
if (!guild || !this.client.guilds.has(guild.id)) return false;
return this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false) ||
guild.me.permissions.has(Permissions.FLAGS.MANAGE_GUILD);
}

/**
* The timestamp the invite will expire at
* @type {?number}
Expand Down
3 changes: 1 addition & 2 deletions typings/index.d.ts
Expand Up @@ -615,8 +615,7 @@ declare module 'discord.js' {
constructor(client: Client, data: object);
public channel: GuildChannel;
public code: string;
public readonly deletable: boolean;
public readonly createdAt: Date | null;
public readonly createdAt: Date;
public createdTimestamp: number | null;
public readonly expiresAt: Date | null;
public readonly expiresTimestamp: number | null;
Expand Down

0 comments on commit c9767d4

Please sign in to comment.