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

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shamil-FD committed Aug 1, 2021
1 parent 0116042 commit 3b04922
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
14 changes: 10 additions & 4 deletions src/Commands/Staff/SetColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,16 @@ module.exports = class SetColorCommand extends Command {
if (message.options.size < 0)
return message.editReply({ ephemeral: true, content: 'You have to choose at least one option.' });

doc.infoCard.borders = message.options.get('borders')?.value ?? doc.infoCard?.borders;
doc.infoCard.background = message.options.get('background')?.value ?? doc.infoCard?.background;
doc.infoCard.img = message.options.get('image')?.value ?? 'none';
doc.infoCard.text = message.options.get('text')?.value ?? doc.infoCard?.text;
// Variables:
let border = message.options.get('borders')?.value;
let bkg = message.options.get('background')?.value;
let img = message.options.get('image')?.value;
let text = message.options.get('text')?.value;

border ? doc.infoCard.borders = border : null;
bkg ? doc.infoCard.background = bkg : null;
img ? doc.infoCard.img = img : null;
text ? doc.infoCard.text = text : null;
await doc.save();
return message.editReply({ content: 'Successfully saved changes.', ephemeral: true });
}
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/ButtonInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ module.exports = class ButtonListener extends Listener {
this.client.config.arrow
} **Code**: \`${doc.code}\`\n${this.client.config.arrow} **Tries**: \`${doc.count}\`\n${
this.client.config.arrow
} **Time Took To Verify**: ${moment(doc.startedAt).from(moment(), true)}`,
} **Time Took To Verify**: ${moment(new Date(doc.startedAt)).from(moment(), true)}`,
)
.setTitle('Member Verfied'),
],
Expand Down
11 changes: 6 additions & 5 deletions src/Listeners/Ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ module.exports = class ReadyListener extends Listener {
.setAuthor('Welcome back!!')
.setThumbnail('https://cf.ltkcdn.net/kids/images/std/198106-425x283-Very-Excited-Toddler.jpg')
.addField('Reason:', l.reason)
.addField('Started On:', Formatters.time(l.start, 'f'), true)
.addField('Ended On:', Formatters.time(l.end, 'f'), true),
.addField('Started On:', l.start, true)
.addField('Ended On:', l.end, true),
],
});
await models.leave.findOneAndDelete({ user: l.user });
Expand Down Expand Up @@ -155,7 +155,6 @@ module.exports = class ReadyListener extends Listener {

let checkedInUsers = [];
let notCheckedInUsers = [];
let time = Formatters.time(Date.now(), 't');
for (let i = 0; staffDocs.length > i; i++) {
if (staffDocs[i]?.msgInfo?.dailyCount <= staffDocs[i]?.msgInfo?.today) {
checkedInUsers.push({ user: staffDocs[i]?.user, count: staffDocs[i]?.msgInfo?.today });
Expand All @@ -181,7 +180,8 @@ module.exports = class ReadyListener extends Listener {
this.client.tools
.embed()
.setColor('RED')
.setFooter(`Inactive Staff | Last Edited At ${time}`)
.setFooter(`Inactive Staff | Last Edited`)
.setTimestamp()
.setDescription(
notCheckedInUsers
.map((item) => `${this.client.config.cross} <@${item.user}> - ${item.count}/${item.dailyCount} messages today`)
Expand Down Expand Up @@ -286,7 +286,8 @@ module.exports = class ReadyListener extends Listener {
this.client.tools
.embed()
.setDescription(`${staffRole.members.map((m) => `:x: <@${m.user.id}>`).join('\n')}`)
.setFooter(`Inactive Staff | Last Edited At ${Formatters.time(Date.now(), 't')}`),
.setFooter(`Inactive Staff | Last Edited`)
.setTimestamp(),
],
});
this.client.config.CheckinUpdate = false;
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ let client = new Client({
cross: '❌',
arrow: '❯',
prefix: 't)',
testMode: true,
testMode: false,
});
client.start({ Token });

0 comments on commit 3b04922

Please sign in to comment.