Skip to content

Commit edf32d2

Browse files
authored
v5.0.1 (#29)
This update includes fixes to commands: * userinfo -> corrected default avatar handling. * config -> Patch bug where supplying 'next' to the default results in the bot having a fit about json in console, not continuing for user. * botcontrols -> You can now restart the bot and actually restart it. No more reloading everything but the main bot.js file. Also including fixes to: * All events requiring audit log pulling -> Patched bug where fetching audit log data got the wrong user. For instance, for a user deleting their own message, it would show the last user who deleted their message prior. * ready event -> Patched bug where invite caching causes 429 (ratelimit) errors and possible improper logging of invites. * verification -> Patched bug where running multiple verification may cause the database to freak out because the primary key was set to serverID and not something like code.
1 parent df16e2c commit edf32d2

23 files changed

+131
-81
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ This guide will assume you've left `app` in `src` (the way it should be).
3737
| Version | Release Date |
3838
| ------- | ------------ |
3939
| 5.0.0 | 3/10/2022 |
40+
| 5.0.1 | 3/15/2022 |
4041

4142
## Contributing
4243
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

src/app/cfg/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const app = {
1515
version: {
1616
major: 5,
1717
minor: 0,
18-
revision: 0,
19-
buildType: "A",
18+
revision: 1,
19+
buildType: "R",
2020
toString: function() {
2121
var major = app.version.major,
2222
minor = app.version.minor,
@@ -590,4 +590,4 @@ const app = {
590590
]
591591
}
592592

593-
module.exports = app;
593+
module.exports = app;

src/app/cmds/General/userinfo.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module.exports = {
2929
user.tag = `${user.username}#${user.discriminator}`; // Manually add this so it looks cool
3030

3131
var embed = {
32-
thumbnail: { url: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.${app.functions.isAnimated(user.avatar) ? "gif": "png"}?size=1024` },
3332
title: `${app.config.system.emotes.information} **${user.tag} ${(user.bot ? "*[BOT]*" : "")}**`,
3433
color: (user["accent_color"]) ? user["accent_color"] : app.config.system.embedColors.blue,
3534
fields: [
@@ -40,6 +39,12 @@ module.exports = {
4039
]
4140
};
4241

42+
if (user.avatar != null)
43+
embed["thumbnail"] = { url: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.${app.functions.isAnimated(user.avatar) ? "gif": "png"}?size=1024` };
44+
else
45+
embed["thumbnail"] = { url: `https://cdn.discordapp.com/embed/avatars/${user.discriminator % 5}.png?size=1024` };
46+
47+
4348
if (user.banner != null)
4449
embed["image"] = { url: `https://cdn.discordapp.com/banners/${user.id}/${user.banner}.${app.functions.isAnimated(user.banner) ? "gif": "png"}?size=600` };
4550

src/app/cmds/Moderation/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,15 @@ module.exports = {
325325
msgCollector.stop("cancelled by user");
326326
m.react(app.config.system.emotes.success).catch(err => {});
327327
} else if (m.content == "next") {
328-
var tmpContent = JSON.parse(serverSettings.get("other")[val]) || { msg: defaults[val][msg], channel: null };
328+
var tmpContent = (serverSettings.get("other")[val]) ? JSON.parse(serverSettings.get("other")[val]) || { msg: defaults[val]["msg"], channel: null } : { msg: defaults[val]["msg"], channel: null };
329329
if (tmpContent["msg"]) {
330330
msgCollector.stop("done");
331-
await collectJoinLeaveChannel(val, null);
331+
await collectJoinLeaveChannel(val, tmpContent);
332332
m.react(app.config.system.emotes.success).catch(err => {});
333333
} else m.react(app.config.system.emotes.error).catch(err => {});
334334
} else {
335335
msgCollector.stop("done");
336-
var tmpContent = { msg: m.content || defaults[val][msg], channel: null };
336+
var tmpContent = { msg: m.content || defaults[val]["msg"], channel: null };
337337
await collectJoinLeaveChannel(val, tmpContent);
338338
m.react(app.config.system.emotes.success).catch(err => {});
339339
}
@@ -432,7 +432,7 @@ module.exports = {
432432
embeds: [{
433433
title: `${app.config.system.emotes.success} Configure ${app.name}`,
434434
color: app.config.system.embedColors.lime,
435-
description: `Woohoo! We're done here!\nYour ${evtType} message & channel are both ready to go!`
435+
description: `Woohoo! We're done here!\nYour ${evtType} message & channel are both ready to go!\n\n\`${evtData["msg"]}\``
436436
}],
437437
components: [],
438438
author: message.author

src/app/cmds/Owner/botcontrols.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
title: `${app.config.system.emotes.warning} **${type}**`,
3030
color: app.config.system.embedColors.yellow,
3131
fields: [
32-
{ name: `Are you sure you wish for me to ${type}?`, value: `To confirm, use the buttons.${((type == "Restart") ? "\n*This will not reload the main bot file.*" : "")}` }
32+
{ name: `Are you sure you wish for me to ${type}?`, value: `To confirm, use the buttons.` }
3333
]
3434
}],
3535
components: [row]
@@ -51,10 +51,9 @@ module.exports = {
5151
}, 1, true, (async() => {
5252
app.logger.debug("SYS", `${app.name} ${actionDoing.toLowerCase()} as of ${new Date()}.`);
5353
if (type == "Restart") {
54-
await process.exitHandler({ app: app, cleanup: true, exit: false }, 0);
54+
try { app.modules.fs.writeFileSync(process.cwd() + "/cache/restart.tmp", msg.channel.id + "-" + msg.id); } catch (Ex) {};
55+
await process.exitHandler({ app: app, cleanup: true, exit: false, restart: true }, 0);
5556

56-
await app.functions.clearCache();
57-
await app.botStart(msg.channel.id + "-" + msg.id);
5857
} else { process.exitHandler({ app: app, cleanup: true, exit: true }, 0); };
5958
}));
6059
denied = false, buttonStuffWaiting = false;

src/app/evts/channelCreate.js

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

3232
//define channelLog
3333
const channelLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the channel was created.
34-
Date.now() - entry.createdTimestamp < 20000
34+
Date.now() - entry.createdTimestamp < 5000
3535
);
3636
if (channelLog) {
3737
const { executor } = channelLog;

src/app/evts/channelDelete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = async(app, oldChannel) => {
3030
if (fetchedLogs) {
3131
//define channelLog
3232
const channelLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the channel was deleted.
33-
Date.now() - entry.createdTimestamp < 20000
33+
Date.now() - entry.createdTimestamp < 5000
3434
);
3535
if (channelLog) {
3636
const { executor } = channelLog;

src/app/evts/channelUpdate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = async(app, oldChannel, newChannel) => {
4949

5050
//define channelLog
5151
const channelLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the channel was updated.
52-
Date.now() - entry.createdTimestamp < 20000
52+
Date.now() - entry.createdTimestamp < 5000
5353
);
5454
if (channelLog) {
5555
const { executor } = channelLog;

src/app/evts/emojiCreate.js

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

3232
//define emojiLog
3333
const emojiLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the emoji was created.
34-
Date.now() - entry.createdTimestamp < 20000
34+
Date.now() - entry.createdTimestamp < 5000
3535
);
3636
if (emojiLog) {
3737
const { executor } = emojiLog;

src/app/evts/emojiDelete.js

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

3232
//define emojiLog
3333
const emojiLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the emoji was created.
34-
Date.now() - entry.createdTimestamp < 20000
34+
Date.now() - entry.createdTimestamp < 5000
3535
);
3636
if (emojiLog) {
3737
const { executor } = emojiLog;

0 commit comments

Comments
 (0)