Skip to content

Commit 38d91cc

Browse files
committed
chore(Message): support message size up to 4096
1 parent ab0cede commit 38d91cc

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "vk2discord",
3-
"version": "2.1.7",
3+
"version": "2.1.8",
44
"LATEST_CONFIG_VERSION": 4,
55
"description": "Автоматическая публикация записей из группы или профиля VK.COM в канал Discord.",
66
"main": "build/index.js",
7+
"type": "module",
78
"scripts": {
89
"start": "node --experimental-modules --experimental-json-modules --unhandled-rejections=warn --es-module-specifier-resolution=node ./dist/index.js",
910
"prestart": "node --experimental-modules --experimental-json-modules --unhandled-rejections=warn --es-module-specifier-resolution=node ./scripts/check.mjs",
@@ -12,10 +13,9 @@
1213
"update": "node --experimental-modules --experimental-json-modules --unhandled-rejections=warn --es-module-specifier-resolution=node ./scripts/update.mjs",
1314
"pretest": "npm run-script build",
1415
"test": "npm run-script eslint:check && node --experimental-modules --experimental-json-modules node_modules/mocha/bin/_mocha --reporter spec --exit --timeout=30000",
15-
"eslint:check": "eslint ./src/**/*",
16+
"eslint:github-action": "eslint ./src/**/*",
1617
"eslint:fix": "eslint ./src/**/* --fix"
1718
},
18-
"type": "module",
1919
"homepage": "https://github.com/MrZillaGold/VK2Discord#readme",
2020
"repository": {
2121
"type": "git",

src/modules/Message.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ export class Message {
9898
private sliceMessage(): void {
9999
const { post, repost } = this;
100100

101-
if ((post + repost).length > 2048) {
101+
if ((post + repost).length > 4096) {
102102
if (post) {
103-
this.post = Message.sliceFix(`${post.slice(0, (repost ? 1024 : 2048) - 3)}…\n`);
103+
this.post = Message.sliceFix(`${post.slice(0, (repost ? 2048 : 4096) - 3)}…\n`);
104104
}
105105

106106
if (repost) {
107-
this.repost = Message.sliceFix(`${repost.slice(0, (post ? 1024 : 2048) - 1)}…`);
107+
this.repost = Message.sliceFix(`${repost.slice(0, (post ? 2048 : 4096) - 1)}…`);
108108
}
109109
}
110110
}

0 commit comments

Comments
 (0)