mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
feat(Guild): backport misc properties and setRolePositions (#3337)
* feat(Guild): backport misc properties and setRolePositions PRs: * #3168 * #3317 * typings
This commit is contained in:
@@ -499,6 +499,10 @@ class RESTMethods {
|
||||
.then(data => this.client.actions.GuildMemberGet.handle(guild, data).member);
|
||||
}
|
||||
|
||||
getGuild(guild) {
|
||||
return this.rest.makeRequest('get', Endpoints.Guild(guild), true);
|
||||
}
|
||||
|
||||
getGuildMember(guild, userID, cache) {
|
||||
return this.rest.makeRequest('get', Endpoints.Guild(guild).Member(userID), true).then(data => {
|
||||
if (cache) return this.client.actions.GuildMemberGet.handle(guild, data).member;
|
||||
@@ -886,23 +890,6 @@ class RESTMethods {
|
||||
.then(() => user);
|
||||
}
|
||||
|
||||
updateChannelPositions(guildID, channels) {
|
||||
const data = new Array(channels.length);
|
||||
for (let i = 0; i < channels.length; i++) {
|
||||
data[i] = {
|
||||
id: this.client.resolver.resolveChannelID(channels[i].channel),
|
||||
position: channels[i].position,
|
||||
};
|
||||
}
|
||||
|
||||
return this.rest.makeRequest('patch', Endpoints.Guild(guildID).channels, true, data).then(() =>
|
||||
this.client.actions.GuildChannelsPositionUpdate.handle({
|
||||
guild_id: guildID,
|
||||
channels,
|
||||
}).guild
|
||||
);
|
||||
}
|
||||
|
||||
updateEmbed(guildID, embed, reason) {
|
||||
return this.rest.makeRequest('patch', Endpoints.Guild(guildID).embed, true, {
|
||||
enabled: embed.enabled,
|
||||
|
||||
Reference in New Issue
Block a user