mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
man....
This commit is contained in:
parent
0baaa76be3
commit
fb8b1d8496
1 changed files with 10 additions and 2 deletions
|
@ -8,7 +8,11 @@ module.exports.init = async client => {
|
|||
const cronjob = new CronJob("0 5 * * *", async function () {
|
||||
client.guilds.cache.forEach(async guild => {
|
||||
const guildData = await client.getGuildData(guild.id);
|
||||
const channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
|
||||
let channel;
|
||||
|
||||
try {
|
||||
channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
|
||||
} catch (e) { /* Nothing */ }
|
||||
|
||||
if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) {
|
||||
const date = new Date(),
|
||||
|
@ -70,7 +74,11 @@ module.exports.init = async client => {
|
|||
module.exports.run = async client => {
|
||||
client.guilds.cache.forEach(async guild => {
|
||||
const guildData = await client.getGuildData(guild.id);
|
||||
const channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
|
||||
let channel;
|
||||
|
||||
try {
|
||||
channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
|
||||
} catch (e) { /* Nothing */ }
|
||||
|
||||
if (guildData.plugins.birthdays) {
|
||||
const date = new Date(),
|
||||
|
|
Loading…
Reference in a new issue