Skip to content

Commit af89215

Browse files
committed
chore(Sender): fix webhooks check
1 parent 17a933a commit af89215

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vk2discord",
3-
"version": "2.1.6",
3+
"version": "2.1.7",
44
"LATEST_CONFIG_VERSION": 4,
55
"description": "Автоматическая публикация записей из группы или профиля VK.COM в канал Discord.",
66
"main": "build/index.js",

src/modules/Sender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class Sender extends Message {
6363

6464
const results = await Promise.allSettled(
6565
webhook_urls.map((url, webhookIndex) => {
66-
const isWebHookUrl = WEBHOOK_REGEXP.exec(url);
66+
const isWebHookUrl = url.match(WEBHOOK_REGEXP);
6767

6868
if (isWebHookUrl) {
6969
const [, id, token] = isWebHookUrl;

src/modules/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { VK } from "./VK.js";
77
import { db } from "./DB.js";
88

99
export const LINK_PREFIX = "https://vk.com/";
10-
export const WEBHOOK_REGEXP = /^https:\/\/(?:\w+\.)?discord(?:app)?\.com\/api\/webhooks\/([^]+)\/([^/]+)$/g;
10+
export const WEBHOOK_REGEXP = /^https:\/\/(?:\w+\.)?discord(?:app)?\.com\/api\/webhooks\/([^]+)\/([^/]+)$/;
1111

1212
// eslint-disable-next-line require-await
1313
export async function getResourceId(VK: VK, resource: string): Promise<number | null> {

0 commit comments

Comments
 (0)