1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-24 22:46:41 +07:00

make roll query matcher less strict

This commit is contained in:
Fedor Katurov 2023-12-30 18:18:36 +07:00
parent 621b03fb70
commit 0b663fb96f

View file

@ -86,7 +86,7 @@ const getRoute = async (
export const roll = async (text: string) => {
try {
const parts = text.match(/^\/roll\s?(\d+)?[-\s,]?(\d+)?$/);
const parts = text.match(/^\/roll\s?(\d+)?[-\s,]{0,3}(\d+)?$/);
const result = await getRoute(parseVal(parts?.[1]), parseVal(parts?.[2]));
if (!result || !result?.id) {