@stonyx/discord 0.1.1-alpha.18 → 0.1.1-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bot.js +16 -1
- package/package.json +3 -3
package/dist/bot.js
CHANGED
|
@@ -159,11 +159,26 @@ export default class DiscordBot {
|
|
|
159
159
|
const channel = await this.client.channels.fetch(channelId);
|
|
160
160
|
if (!channel)
|
|
161
161
|
throw new Error('Invalid Channel ID');
|
|
162
|
+
const sendable = channel;
|
|
163
|
+
if (content.length > 2000) {
|
|
164
|
+
const chunks = chunkMessage('', content);
|
|
165
|
+
let firstMessage;
|
|
166
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
167
|
+
const options = { content: chunks[i] };
|
|
168
|
+
if (i === 0 && imagePath) {
|
|
169
|
+
options.files = [new AttachmentBuilder(imagePath)];
|
|
170
|
+
}
|
|
171
|
+
const msg = await sendable.send(options);
|
|
172
|
+
if (i === 0)
|
|
173
|
+
firstMessage = msg;
|
|
174
|
+
}
|
|
175
|
+
return firstMessage;
|
|
176
|
+
}
|
|
162
177
|
const options = { content };
|
|
163
178
|
if (imagePath) {
|
|
164
179
|
options.files = [new AttachmentBuilder(imagePath)];
|
|
165
180
|
}
|
|
166
|
-
return await
|
|
181
|
+
return await sendable.send(options);
|
|
167
182
|
}
|
|
168
183
|
async sendMessage(content, channelId, imagePath = null) {
|
|
169
184
|
if (this._connectionState === 'ready') {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"stonyx-async",
|
|
5
5
|
"stonyx-module"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.1.1-alpha.
|
|
7
|
+
"version": "0.1.1-alpha.19",
|
|
8
8
|
"description": "Discord bot module for the Stonyx framework",
|
|
9
9
|
"main": "dist/main.js",
|
|
10
10
|
"types": "dist/main.d.ts",
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
"stonyx": ">=0.2.3-beta.4"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@stonyx/utils": "0.2.3-beta.
|
|
67
|
+
"@stonyx/utils": "0.2.3-beta.26",
|
|
68
68
|
"@types/node": "^25.5.2",
|
|
69
69
|
"@types/qunit": "^2.19.13",
|
|
70
70
|
"@types/sinon": "^21.0.1",
|
|
71
71
|
"qunit": "^2.24.1",
|
|
72
72
|
"sinon": "^21.0.0",
|
|
73
|
-
"stonyx": "0.2.3-beta.
|
|
73
|
+
"stonyx": "0.2.3-beta.69",
|
|
74
74
|
"tsx": "^4.21.0",
|
|
75
75
|
"typescript": "^5.8.3"
|
|
76
76
|
},
|