make positions for channels and roles nicer (#1211)

* make role calculated position nicer

* make channels sortable in a nice way too

* stupid git web rebase editor

* Update Guild.js

* Update Guild.js

* Update Guild.js

* Update Guild.js

* Update RESTMethods.js
This commit is contained in:
Gus Caplan
2017-04-01 01:28:54 -05:00
committed by Crawl
parent c4e5292516
commit a4e0af2e45
7 changed files with 142 additions and 54 deletions

View File

@@ -1,21 +1,21 @@
const Action = require('./Action');
class GuildChannelsPositionUpdate extends Action {
handle(data) {
const client = this.client;
const guild = client.guilds.get(data.guild_id);
if (guild) {
for (const partialChannel of data.channels) {
const channel = guild.roles.get(partialChannel.id);
if (channel) channel.position = partialChannel.position;
}
}
return {
guild,
};
}
}
module.exports = GuildChannelsPositionUpdate;
const Action = require('./Action');
class GuildChannelsPositionUpdate extends Action {
handle(data) {
const client = this.client;
const guild = client.guilds.get(data.guild_id);
if (guild) {
for (const partialChannel of data.channels) {
const channel = guild.channels.get(partialChannel.id);
if (channel) channel.position = partialChannel.position;
}
}
return {
guild,
};
}
}
module.exports = GuildChannelsPositionUpdate;