woomy/events/ready.js

30 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2020-04-20 04:52:50 +00:00
// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license.
2020-04-20 03:02:10 +00:00
2020-04-06 09:36:32 +00:00
const moment = require('moment')
2020-03-30 08:46:36 +00:00
module.exports = (client) => {
2020-04-06 09:36:32 +00:00
const timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
2020-04-04 09:16:05 +00:00
const activities = client.commands.keyArray()
let activity = activities.random()
client.user.setActivity(`${client.config.defaultPrefix + activity} | v${client.version.number}`, { type: 'PLAYING' })
2020-04-04 09:16:05 +00:00
setInterval(() => {
activity = activities.random()
if (client.lockActivity === false) {
client.user.setActivity(`${client.config.defaultPrefix + activity} | v${client.version.number}`, { type: 'PLAYING' })
2020-04-04 09:16:05 +00:00
};
2020-04-06 09:36:32 +00:00
}, 20000)
// REMOVE ! IN FRONT OF CLIENT.CONFIG.SUPPORT.ID WHEN DEVMODE WORKS
if (!client.config.support.id && client.config.support.startupLogs && client.devmode === false) {
try {
const guild = client.guilds.cache.get(client.config.support.id)
const channel = guild.channels.cache.get(client.config.support.startupLogs)
channel.send(`Bot started at \`${timestamp}\``)
} catch (err) {}
}
2020-04-04 09:16:05 +00:00
2020-03-31 07:59:09 +00:00
client.logger.ready('Connected to Discord as ' + client.user.tag)
2020-03-30 16:01:13 +00:00
}