mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Fix leaving guilds if you are the owner
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -176,6 +176,9 @@ class RESTMethods {
|
|||||||
}
|
}
|
||||||
|
|
||||||
leaveGuild(guild) {
|
leaveGuild(guild) {
|
||||||
|
if (guild.owner.id === this.rest.client.user.id) {
|
||||||
|
return this.deleteGuild(guild);
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.rest.makeRequest('del', Constants.Endpoints.meGuild(guild.id), true)
|
this.rest.makeRequest('del', Constants.Endpoints.meGuild(guild.id), true)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user