Fix regex handling one-line codeblocks (#10)

This commit is contained in:
tipakA 2019-07-26 15:49:49 +02:00 committed by 1Computer1
parent 8b25b609c6
commit ade6ba0299

View file

@ -59,7 +59,7 @@ class MessageInvalidListener extends Listener {
return null; return null;
} }
const regex = /^\s*(`{1,3})(.+?)\n([^]+)\1\s*$/; const regex = /^\s*(`{1,3})(.+?)[ \n]([^]+)\1\s*$/;
const match = message.content.slice(prefix.length).match(regex); const match = message.content.slice(prefix.length).match(regex);
if (!match) { if (!match) {
return null; return null;