fix crash
This commit is contained in:
parent
132a6a0a7c
commit
f636aa907f
1 changed files with 8 additions and 14 deletions
|
@ -40,24 +40,18 @@ class fakebotCommand extends Command {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
sendWebhook(this.client);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
sendWebhook(this.client);
|
|
||||||
}
|
}
|
||||||
|
let webhook = require(`../../webhook/${message.guild.id}.json`);
|
||||||
function sendWebhook(client) {
|
this.client.fetchWebhook(webhook.id, webhook.token)
|
||||||
let webhook = require(`../../webhook/${message.guild.id}.json`);
|
.then(webhook => {
|
||||||
client.fetchWebhook(webhook.id, webhook.token)
|
webhook.edit({
|
||||||
.then(webhook => {
|
name: args.member.username,
|
||||||
webhook.edit({
|
avatar: args.member.displayAvatarURL()
|
||||||
name: args.member.username,
|
|
||||||
avatar: args.member.displayAvatarURL()
|
|
||||||
});
|
|
||||||
return webhook.send(args.message);
|
|
||||||
});
|
});
|
||||||
}
|
return webhook.send(args.message);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = fakebotCommand;
|
module.exports = fakebotCommand;
|
Loading…
Reference in a new issue