help command (unfinished)
This commit is contained in:
parent
b2531d49b0
commit
3b8234fea7
7 changed files with 572 additions and 11 deletions
|
@ -5,6 +5,8 @@ module.exports = async (client, message) => {
|
|||
|
||||
data.userData = await client.findOrCreateUser(message.author)
|
||||
|
||||
const prefixes = [data.userData.prefix]
|
||||
|
||||
if (message.guild) {
|
||||
if (!message.channel.permissionsFor(client.user).has('SEND_MESSAGES')) {
|
||||
try {
|
||||
|
@ -12,17 +14,13 @@ module.exports = async (client, message) => {
|
|||
} catch (err) {}
|
||||
}
|
||||
data.guildData = await client.findOrCreateGuild(message.guild)
|
||||
prefixes.push(data.guildData.prefix)
|
||||
}
|
||||
|
||||
const prefixes = [data.userData.prefix, data.guildData.prefix]
|
||||
prefixes.push(`<@${client.user.id}> `, `<@!${client.user.id}> `)
|
||||
|
||||
let prefix
|
||||
|
||||
const prefixMention = new RegExp(`^<@!?${client.user.id}> `)
|
||||
if (message.content.match(prefixMention) ? message.content.match(prefixMention)[0] : '!') {
|
||||
prefix = message.content.match(prefixMention) ? message.content.match(prefixMention)[0] : '!'
|
||||
}
|
||||
|
||||
for (const thisPrefix of prefixes) {
|
||||
if (message.content.startsWith(thisPrefix)) prefix = thisPrefix
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const moment = require('moment')
|
||||
module.exports = (client) => {
|
||||
const timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
const activities = client.commands.keyArray()
|
||||
let activity = activities.random()
|
||||
|
||||
|
@ -9,7 +11,17 @@ module.exports = (client) => {
|
|||
if (client.lockActivity === false) {
|
||||
client.user.setActivity(`${client.config.defaultPrefix + activity} | v${client.version.number}`, { type: 'PLAYING' })
|
||||
};
|
||||
}, 30000)
|
||||
}, 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) {}
|
||||
}
|
||||
|
||||
client.logger.ready('Connected to Discord as ' + client.user.tag)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue