mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-09-04 16:15:19 +00:00
Check for errors in formatting of new custom commands, closes #88
This commit is contained in:
@@ -72,6 +72,15 @@ const addCustomCmdHandler = async (ctx, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (command.state === 'content') {
|
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);
|
const newCommand = createNewCommand(ctx);
|
||||||
|
|
||||||
await updateCommand({ ...newCommand, id, isActive: true, state: null });
|
await updateCommand({ ...newCommand, id, isActive: true, state: null });
|
||||||
|
Reference in New Issue
Block a user