mirror of
https://github.com/LBRYFoundation/curate.git
synced 2025-08-23 17:37:25 +00:00
Hotfix client config stuff
This commit is contained in:
parent
a4d6f05765
commit
b4aa944723
4 changed files with 7 additions and 6 deletions
|
@ -20,11 +20,11 @@ module.exports = class Events {
|
||||||
if (this.client.messageAwaiter.processHalt(message)) return;
|
if (this.client.messageAwaiter.processHalt(message)) return;
|
||||||
|
|
||||||
// Command parsing
|
// Command parsing
|
||||||
const argInterpretor = new ArgumentInterpreter(Util.Prefix.strip(message, this.client, [config.prefix]));
|
const argInterpretor = new ArgumentInterpreter(Util.Prefix.strip(message, this.client));
|
||||||
const args = argInterpretor.parseAsStrings();
|
const args = argInterpretor.parseAsStrings();
|
||||||
const commandName = args.splice(0, 1)[0];
|
const commandName = args.splice(0, 1)[0];
|
||||||
const command = this.client.cmds.get(commandName, message);
|
const command = this.client.cmds.get(commandName, message);
|
||||||
if (!message.content.match(Util.Prefix.regex(this.client, [config.prefix])) || !command) return;
|
if (!message.content.match(Util.Prefix.regex(this.client)) || !command) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await command._exec(message, {
|
await command._exec(message, {
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Command {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_preload() {
|
_preload() {
|
||||||
if (!this.preload() && this.client.config.debug)
|
if (!this.preload() && config.debug)
|
||||||
this.client.cmds.logger.info('Preloading command', this.name);
|
this.client.cmds.logger.info('Preloading command', this.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
const Paginator = require('./Paginator');
|
const Paginator = require('./Paginator');
|
||||||
const lodash = require('lodash');
|
const lodash = require('lodash');
|
||||||
|
const config = require('config');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A generic pager that shows a list of items
|
* A generic pager that shows a list of items
|
||||||
|
@ -62,7 +63,7 @@ class GenericPager extends Paginator {
|
||||||
description: this.header || undefined,
|
description: this.header || undefined,
|
||||||
footer: this.footer ? { text: this.footer } : undefined,
|
footer: this.footer ? { text: this.footer } : undefined,
|
||||||
fields: []
|
fields: []
|
||||||
}, this.embedExtra, { color: this.client.config.embedColor });
|
}, this.embedExtra, { color: config.embedColor });
|
||||||
|
|
||||||
embed.fields.push({
|
embed.fields.push({
|
||||||
name: '*List Prompt*',
|
name: '*List Prompt*',
|
||||||
|
|
|
@ -104,7 +104,7 @@ Util.Random = {
|
||||||
Util.Prefix = {
|
Util.Prefix = {
|
||||||
regex(client, prefixes = null) {
|
regex(client, prefixes = null) {
|
||||||
if (!prefixes)
|
if (!prefixes)
|
||||||
prefixes = [client.config.prefix];
|
prefixes = [config.prefix];
|
||||||
return new RegExp(`^((?:<@!?${client.user.id}>|${
|
return new RegExp(`^((?:<@!?${client.user.id}>|${
|
||||||
prefixes.map(prefix => Util.Escape.regex(prefix)).join('|')})\\s?)(\\n|.)`, 'i');
|
prefixes.map(prefix => Util.Escape.regex(prefix)).join('|')})\\s?)(\\n|.)`, 'i');
|
||||||
},
|
},
|
||||||
|
@ -149,7 +149,7 @@ Util.CommandPermissions = {
|
||||||
emoji: (client, message) => message.channel.type === 1 ||
|
emoji: (client, message) => message.channel.type === 1 ||
|
||||||
message.channel.permissionsOf(client.user.id).has('externalEmojis'),
|
message.channel.permissionsOf(client.user.id).has('externalEmojis'),
|
||||||
guild: (_, message) => !!message.guildID,
|
guild: (_, message) => !!message.guildID,
|
||||||
elevated: (client, message) => client.config.elevated.includes(message.author.id),
|
elevated: (_, message) => config.elevated.includes(message.author.id),
|
||||||
curator: (client, message) => {
|
curator: (client, message) => {
|
||||||
const member = message.guildID ? message.member :
|
const member = message.guildID ? message.member :
|
||||||
client.guilds.get(config.guildID).members.get(message.author.id);
|
client.guilds.get(config.guildID).members.get(message.author.id);
|
||||||
|
|
Loading…
Add table
Reference in a new issue