mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Rebuilt lib for dev and getInvite
This commit is contained in:
@@ -255,12 +255,12 @@ export default class InternalClient {
|
||||
if(!invite) {
|
||||
return Promise.reject(new Error("Not a valid invite"));
|
||||
}
|
||||
|
||||
return this.apiRequest("post", Endpoints.INVITE(invite), true)
|
||||
.then(res => {
|
||||
// valid server, wait until it is received via ws and cached
|
||||
return waitFor(() => this.servers.get("id", res.guild.id));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//def leaveServer
|
||||
@@ -762,7 +762,6 @@ export default class InternalClient {
|
||||
|
||||
//def deleteInvite
|
||||
deleteInvite(invite) {
|
||||
|
||||
invite = this.resolver.resolveInviteID(invite);
|
||||
if(!invite) {
|
||||
throw new Error("Not a valid invite");
|
||||
@@ -770,6 +769,17 @@ export default class InternalClient {
|
||||
return this.apiRequest("del", Endpoints.INVITE(invite), true);
|
||||
}
|
||||
|
||||
//def getInvite
|
||||
getInvite(invite) {
|
||||
invite = this.resolver.resolveInviteID(invite);
|
||||
if(!invite) {
|
||||
return Promise.reject(new Error("Not a valid invite"));
|
||||
}
|
||||
|
||||
return this.apiRequest("get", Endpoints.INVITE(invite), true)
|
||||
.then(res => new Invite(res, this.channels.get("id", res.channel.id), this.client));
|
||||
}
|
||||
|
||||
//def overwritePermissions
|
||||
overwritePermissions(channel, role, updated) {
|
||||
return this.resolver.resolveChannel(channel)
|
||||
|
||||
Reference in New Issue
Block a user