Skip to content

Commit

Permalink
Fix destructuring errors in GuildChannelStore and RoleStore (#2244)
Browse files Browse the repository at this point in the history
* Permissions#resolve fix

* Travis failed because >120 chars per line

* better fix

Permissions#resolve reverted
removed destructuring in GuildChannelStore and RoleStore
  • Loading branch information
Jisagi authored and amishshah committed Jan 13, 2018
1 parent 8aafcd6 commit ea028ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/stores/GuildChannelStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Channel = require('../structures/Channel');
const { ChannelTypes } = require('../util/Constants');
const DataStore = require('./DataStore');
const GuildChannel = require('../structures/GuildChannel');
const { resolve } = require('../util/Permissions');
const Permissions = require('../util/Permissions');

/**
* Stores guild channels.
Expand Down Expand Up @@ -54,8 +54,8 @@ class GuildChannelStore extends DataStore {
overwrites = overwrites.map(overwrite => {
let allow = overwrite.allow || (overwrite.allowed ? overwrite.allowed.bitfield : 0);
let deny = overwrite.deny || (overwrite.denied ? overwrite.denied.bitfield : 0);
if (allow instanceof Array) allow = resolve(allow);
if (deny instanceof Array) deny = resolve(deny);
if (allow instanceof Array) allow = Permissions.resolve(allow);
if (deny instanceof Array) deny = Permissions.resolve(deny);

const role = this.guild.roles.resolve(overwrite.id);
if (role) {
Expand Down
4 changes: 2 additions & 2 deletions src/stores/RoleStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const DataStore = require('./DataStore');
const Role = require('../structures/Role');
const { resolveColor } = require('../util/Util');
const { resolve } = require('../util/Permissions');
const Permissions = require('../util/Permissions');

/**
* Stores roles.
Expand Down Expand Up @@ -42,7 +42,7 @@ class RoleStore extends DataStore {
*/
create(data = {}, reason) {
if (data.color) data.color = resolveColor(data.color);
if (data.permissions) data.permissions = resolve(data.permissions);
if (data.permissions) data.permissions = Permissions.resolve(data.permissions);

return this.guild.client.api.guilds(this.guild.id).roles.post({ data, reason }).then(r => {
const { role } = this.client.actions.GuildRoleCreate.handle({
Expand Down

0 comments on commit ea028ae

Please sign in to comment.