fix
parent
9be8c9da7e
commit
401b1db9fe
|
@ -17,7 +17,7 @@ export default class DelMerchant extends Command {
|
||||||
public async run(message: Message, args: string[]) {
|
public async run(message: Message, args: string[]) {
|
||||||
try {
|
try {
|
||||||
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
|
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
|
||||||
const merchant = await this.client.db.Merchant.findOne({ _id: args[0] });
|
const merchant = await this.client.db.Merchant.findOne({ key: args[0] });
|
||||||
if (!merchant) return this.error(message.channel, 'Merchant specified does not exist.');
|
if (!merchant) return this.error(message.channel, 'Merchant specified does not exist.');
|
||||||
return this.success(message.channel, `Deleted merchant \`${merchant._id}\`.`);
|
return this.success(message.channel, `Deleted merchant \`${merchant._id}\`.`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue