mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
Add invite.delete()
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -510,6 +510,14 @@ class RESTMethods {
|
|||||||
.catch(reject);
|
.catch(reject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deleteInvite(invite) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.rest.makeRequest('del', Constants.Endpoints.invite(invite.code), true)
|
||||||
|
.then(() => resolve(invite))
|
||||||
|
.catch(reject);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = RESTMethods;
|
module.exports = RESTMethods;
|
||||||
|
|||||||
@@ -92,6 +92,14 @@ class Invite {
|
|||||||
*/
|
*/
|
||||||
this.channels = this.client.channels.get(data.channel.id) || new PartialGuildChannel(this.client, data.channel);
|
this.channels = this.client.channels.get(data.channel.id) || new PartialGuildChannel(this.client, data.channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes this invite
|
||||||
|
* @returns {Promise<Invite, Error>}
|
||||||
|
*/
|
||||||
|
delete() {
|
||||||
|
return this.client.rest.methods.deleteInvite(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Invite;
|
module.exports = Invite;
|
||||||
|
|||||||
Reference in New Issue
Block a user