@alemonjs/discord 2.1.0-alpha.16 → 2.1.0-alpha.17

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.
Files changed (2) hide show
  1. package/lib/index.js +12 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -284,6 +284,18 @@ const mainProcess = () => {
284
284
  if (process.send) {
285
285
  process.send(JSON.stringify({ type: 'ready' }));
286
286
  }
287
+ process.on('message', msg => {
288
+ try {
289
+ const data = typeof msg === 'string' ? JSON.parse(msg) : msg;
290
+ if (data?.type === 'start') {
291
+ main();
292
+ }
293
+ else if (data?.type === 'stop') {
294
+ process.exit(0);
295
+ }
296
+ }
297
+ catch { }
298
+ });
287
299
  };
288
300
  mainProcess();
289
301
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/discord",
3
- "version": "2.1.0-alpha.16",
3
+ "version": "2.1.0-alpha.17",
4
4
  "description": "discord platform connection",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",