Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
v1.1.3
Extending fix from here Jisagi@591c9b8 to categories and voice channels
  • Loading branch information
Jisagi committed Nov 16, 2018
1 parent 3feca70 commit 97b19dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ package-lock.json
# Miscellaneous
guildData.json
logs/
.vscode/
4 changes: 3 additions & 1 deletion objects/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Serializer {
categoryCollection = categoryCollection.sort((a, b) => a.position - b.position);
let categories = categoryCollection.map(category => {
let permOverwritesCollection = category.permissionOverwrites.filter(pOver => pOver.type === 'role');
permOverwritesCollection = permOverwritesCollection.filter(pOver => guildToCopy.roles.has(pOver.id));
let permOverwrites = permOverwritesCollection.map(pOver => {
return {
id: pOver.id,
Expand Down Expand Up @@ -149,7 +150,7 @@ class Serializer {
textChannelCollection = textChannelCollection.sort((a, b) => a.rawPosition - b.rawPosition);
let textChannel = textChannelCollection.map(tCh => {
let permOverwritesCollection = tCh.permissionOverwrites.filter(pOver => pOver.type === 'role');
permOverwritesCollection = permOverwritesCollection.filter(pOver => guildToCopy.roles.has(pOver.id)); // fix for a very rare bug
permOverwritesCollection = permOverwritesCollection.filter(pOver => guildToCopy.roles.has(pOver.id));
let permOverwrites = permOverwritesCollection.map(pOver => {
return {
id: pOver.id,
Expand Down Expand Up @@ -188,6 +189,7 @@ class Serializer {
voiceChannelCollection = voiceChannelCollection.sort((a, b) => a.rawPosition - b.rawPosition);
let voiceChannel = voiceChannelCollection.map(vCh => {
let permOverwritesCollection = vCh.permissionOverwrites.filter(pOver => pOver.type === 'role');
permOverwritesCollection = permOverwritesCollection.filter(pOver => guildToCopy.roles.has(pOver.id));
let permOverwrites = permOverwritesCollection.map(pOver => {
return {
id: pOver.id,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "guildcopy",
"version": "1.1.2",
"version": "1.1.3",
"description": "A tool to copy a discord guild",
"main": "copy.js",
"scripts": {
Expand Down

0 comments on commit 97b19dc

Please sign in to comment.