1
0
Fork 0

get prefix from client, not directly

refactor/models
Matthew 2019-10-27 20:19:55 -04:00
parent f83b62e3c0
commit 38a840e5e5
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 2 additions and 4 deletions

View File

@ -1,9 +1,7 @@
import { Message, TextChannel } from 'eris'; import { Message, TextChannel } from 'eris';
import { Client, config } from '..'; import { Client } from '..';
import Command from '../class/Command'; import Command from '../class/Command';
const { prefix } = config;
export default class { export default class {
public client: Client public client: Client
@ -13,7 +11,7 @@ export default class {
public async run(message: Message) { public async run(message: Message) {
try { try {
const noPrefix: string[] = message.content.slice(prefix.length).trim().split(/ +/g); const noPrefix: string[] = message.content.slice(this.client.config.prefix.length).trim().split(/ +/g);
const command: string = noPrefix[0].toLowerCase(); const command: string = noPrefix[0].toLowerCase();
const resolved: Command = this.client.util.resolveCommand(command); const resolved: Command = this.client.util.resolveCommand(command);
if (!resolved) return; if (!resolved) return;