Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Beta Update 1.1.3
Browse files Browse the repository at this point in the history
Better error handling and silly code mistakes fixed.
  • Loading branch information
17teen committed Jun 22, 2021
1 parent df01cbc commit f70f0ca
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 51 deletions.
5 changes: 3 additions & 2 deletions Global/commands/menu/about.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const Discord = require('discord.js');
const { prefix, author, authorID, github, founder, founderId, sourceCode, SupportServer } = require('../settings.json');
const { red } = require("chalk");

module.exports = {
name: "about",
Expand All @@ -14,8 +15,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | Author: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(about).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(about).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
4 changes: 2 additions & 2 deletions Global/commands/menu/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | By: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(help).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(help).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
5 changes: 4 additions & 1 deletion Global/commands/menu/invite.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const Discord = require('discord.js');
const { inviteLink } = require('../settings.json');
const { red } = require("chalk");

module.exports = {
name: "invite",
Expand All @@ -10,6 +11,8 @@ module.exports = {
const inviteEmbed = new Discord.MessageEmbed()
.setDescription(`[Click Here.](${inviteLink})`)
.setColor(0x36393E);
message.channel.send(inviteEmbed)
message.channel.send(inviteEmbed).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
5 changes: 3 additions & 2 deletions Global/commands/menu/other.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const Discord = require('discord.js');
const { prefix, author } = require('../settings.json');
const { red } = require("chalk");

module.exports = {
name: "other",
Expand All @@ -20,8 +21,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | By: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(help).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(help).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
29 changes: 9 additions & 20 deletions Global/commands/menu/setUp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Discord = require('discord.js');
const { prefix, DEV_TEAM, founderId } = require('../settings.json');
const pagination = require("discord.js-pagination");
const { red } = require("chalk");

module.exports = {
name: "setup",
Expand Down Expand Up @@ -47,21 +48,14 @@ module.exports = {
.setColor(0x36393E)
.setTimestamp(Date.now());

const pages = [
page0,
page1,
page2,
page3,
page4,
page5
]
const pages = [ page0, page1, page2, page3, page4, page5 ]

const emojis = ["⏪", "⏩"];

const timeout = '100000'
const timeout = '100000';

pagination(message, pages, emojis, timeout).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
pagination(message, pages, emojis, timeout).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
} else {
const page0 = new Discord.MessageEmbed()
Expand All @@ -88,19 +82,14 @@ module.exports = {
.setColor(0x36393E)
.setTimestamp(Date.now());

const pages = [
page0,
page1,
page2,
page3,
]
const pages = [ page0, page1, page2, page3 ]

const emojis = ["⏪", "⏩"];

const timeout = '100000'
const timeout = '100000';

pagination(message, pages, emojis, timeout).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
pagination(message, pages, emojis, timeout).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}

Expand Down
8 changes: 4 additions & 4 deletions Private/commands/menu/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | Author: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(about).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(about).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
} else {
Expand Down Expand Up @@ -76,8 +76,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | Author: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(about).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(about).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions Private/commands/menu/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | By: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(help).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(help).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
} else {
Expand Down Expand Up @@ -74,8 +74,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | By: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(help).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(help).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions Private/commands/menu/other.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | By: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(help).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(help).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
} else {
Expand Down Expand Up @@ -87,8 +87,8 @@ module.exports = {
.setFooter(${client.user.username} | Prefix: ${prefix} | By: ${author}`)
.setColor(0x36393E)
.setTimestamp(Date.now());
message.channel.send(help).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
message.channel.send(help).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
Expand Down
18 changes: 6 additions & 12 deletions Private/commands/menu/setUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,11 @@ module.exports = {
.setColor(0x36393E)
.setTimestamp(Date.now());

const pages = [
page1,
page2,
page3,
page4,
page5
]
const pages = [ page1, page2, page3, page4, page5 ]

const emojis = ["⏪", "⏩"];

const timeout = '100000'
const timeout = '100000';

const AllowedGuildIDs = PermittedGuilds.find((g) => g === `${message.guild.id}`)
if (AllowGuilds === false) {
Expand All @@ -76,8 +70,8 @@ module.exports = {
message.guild.leave();
}, 6000)
} else {
pagination(message, pages, emojis, timeout).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
pagination(message, pages, emojis, timeout).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
} else {
Expand All @@ -104,8 +98,8 @@ module.exports = {
message.guild.leave();
}, 6000)
} else {
pagination(message, pages, emojis, timeout).catch(() => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS`));
pagination(message, pages, emojis, timeout).catch((err) => {
console.error(red(`[COMMAND FAILED] : [GUILD] ${message.guild.name} | [CHANNEL] ${message.channel.name} | [REASON] MISSING PERMISSIONS | ${err}`));
});
}
}
Expand Down

0 comments on commit f70f0ca

Please sign in to comment.