mirror of
https://github.com/JonnyBro/JaBa.git
synced 2025-01-01 16:23:02 +05:00
Compare commits
2 commits
8b677f9ec4
...
4728258071
Author | SHA1 | Date | |
---|---|---|---|
4728258071 | |||
6ad65e7019 |
2 changed files with 48 additions and 41 deletions
|
@ -58,13 +58,13 @@ class CommandHandler extends BaseEvent {
|
|||
}
|
||||
|
||||
client.logger.cmd(
|
||||
`User ${interaction.user.getUsername()} used ${command.command.name} in ${interaction.guild ? interaction.guild.name : "DM"} with arguments: ${
|
||||
`[${interaction.guild ? interaction.guild.name : "DM"}]: [${interaction.user.getUsername()}] => /${command.command.name}${
|
||||
interaction.options.data.length > 0
|
||||
? interaction.options.data
|
||||
? ", args: " + interaction.options.data
|
||||
.map(arg => {
|
||||
return `${arg.name}: ${arg.value}`;
|
||||
}).join(", ")
|
||||
: "no args"
|
||||
: ""
|
||||
}`,
|
||||
);
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@ const { CronJob } = require("cron");
|
|||
module.exports.init = async client => {
|
||||
const cronjob = new CronJob("0 5 * * *", async function () {
|
||||
client.guilds.cache.forEach(async guild => {
|
||||
try {
|
||||
console.log(`Checking birthdays for "${guild.name}"`);
|
||||
|
||||
const guildData = await client.getGuildData(guild.id);
|
||||
const channel = guildData.plugins.birthdays ? await client.channels.fetch(guildData.plugins.birthdays) : null;
|
||||
|
||||
|
@ -52,6 +55,10 @@ module.exports.init = async client => {
|
|||
}
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.code === 10003) console.log("Unknown channel");
|
||||
else throw err;
|
||||
}
|
||||
});
|
||||
},
|
||||
null,
|
||||
|
|
Loading…
Reference in a new issue