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:
parent
621b03fb70
commit
0b663fb96f
1 changed files with 1 additions and 1 deletions
|
@ -86,7 +86,7 @@ const getRoute = async (
|
||||||
|
|
||||||
export const roll = async (text: string) => {
|
export const roll = async (text: string) => {
|
||||||
try {
|
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]));
|
const result = await getRoute(parseVal(parts?.[1]), parseVal(parts?.[2]));
|
||||||
|
|
||||||
if (!result || !result?.id) {
|
if (!result || !result?.id) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue