Skip to content

Commit 5493952

Browse files
committed
v5 Update part 2
The moment you've been waiting for! * Fixed a bug where permissions were - for some reason - checking wrongly. * Added a 'debug logs are spammy' message upon starting the bot. * Changed the description of 'softclear' by one word. * It's sad to say goodbye, however 'web' will be moving to its own repo 'TheCodingBot-Extras', which will contain that sweet-sweet dashboard soon! :) Fixed a bug where the bot would response with the prefix when there was a everyone ping. Fixed a bug where hidden commands would still show in help. Maybe not do that please. Removed 'lang' folder. We'll be adding multi-language support once v5 is ready for release. :) Removed lingering 'category' part in '8ball' command.
1 parent 4f4f3dc commit 5493952

19 files changed

Lines changed: 18 additions & 96846 deletions

src/app/cfg/app.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ const app = {
175175
missingPerms: function(message, cantdo, command) {
176176
var lackedPerms = [];
177177
if (command) {
178-
if (command.permissions == "BOT_OWNER") lackingPerms.push("`BOT_OWNER`");
179-
else {
180-
for (var i = 0; i < command.permissions.length; i++) {
181-
if (!message.channel.permissionsFor(message.author).has(command.permissions[i]))
182-
lackingPerms.push("`" + command.permissions[i] + "`");
183-
};
178+
for (var i = 0; i < command.permissions.length; i++) {
179+
permission = command.permissions[i];
180+
if (permission == "BOT_OWNER" ||
181+
permission == "DEFAULT"
182+
)
183+
lackedPerms.push("`" + permission + "`");
184+
else if (!message.member.permissions.has(permission))
185+
lackedPerms.push("`" + permission + "`");
184186
};
185187

186188
lackedPerms = lackedPerms.join(", ");

src/app/cmds/Fun/8ball.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
22
name: "8ball",
33
description: "The magic 8ball will answer *the* question.",
4-
category: "Fun",
54
guildOnly: false,
65
authorizedGuilds: [],
76
hidden: false,

src/app/cmds/General/help.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
var cmds = {},
1717
fields = [];
1818
app.commands.forEach(cmd => {
19-
if (app.functions.hasPermissions(message, cmd)) {
19+
if (app.functions.hasPermissions(message, cmd) || !cmd.hidden) {
2020
var category = cmd.category || "Uncategorized";
2121
if (cmds[category] == undefined) cmds[category] = [];
2222
cmds[category].push("`" + cmd.name + "`");
@@ -44,7 +44,7 @@ module.exports = {
4444
app.commands.forEach(cmd => {
4545
var category = cmd.category || "Uncategorized";
4646
console.log(category)
47-
if (category == categoryName && app.functions.hasPermissions(message, cmd))
47+
if (category == categoryName && app.functions.hasPermissions(message, cmd) && !cmd.hidden)
4848
commands.push("`" + cmd.name + "`");
4949
});
5050
if (commands.length < 1) { return app.functions.missingPerms("view help on " + categoryName, command); };

src/app/cmds/Moderation/softclear.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
name: "softclear",
3-
description: "Soft clears a chat - by sending several lines of empty characters.",
3+
description: "Soft clears a chat - by sending several lines of emptiness.",
44
guildOnly: true,
55
authorizedGuilds: [],
66
hidden: false,

src/app/evts/messageCreate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = async(app, message) => {
3030
};
3131

3232
if (!message.content.startsWith(prefix)) { // If the user did not include prefix
33-
if (message.mentions.has(app.client.user.id) && !message.reference) // ...and did not reply to & actually pinged the bot.
33+
if (message.mentions.has(app.client.user.id) && !message.mentions.everyone && !message.reference) // ...and did not reply to & actually pinged the bot.
3434
return app.functions.msgHandler(message, { content: `n-nya! My prefix is \`${prefix}\`` }, 0, true);
3535
else return;
3636
} else {};
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)