2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 06:05:22 +00:00

Check for errors in formatting of new custom commands, closes #88

This commit is contained in:
GingerPlusPlus
2019-02-23 15:12:01 +01:00
parent bdc10e1702
commit 481f7ac928

View File

@@ -72,6 +72,15 @@ const addCustomCmdHandler = async (ctx, next) => {
}
if (command.state === 'content') {
if (ctx.message.text) {
try {
await ctx.replyWithHTML(ctx.message.text);
} catch (err) {
return ctx.reply(err +
'\n\nPlease fix your content and try again.');
}
}
const newCommand = createNewCommand(ctx);
await updateCommand({ ...newCommand, id, isActive: true, state: null });