mirror of
https://github.com/danbulant/discord.js
synced 2026-07-06 19:50:55 +00:00
Add invite.delete()
This commit is contained in:
parent
ba3d104619
commit
1dba048d2e
3 changed files with 17 additions and 1 deletions
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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue