From f5caa80c4c15f9c906870d8ee2e8590f1bd69e96 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 12 Oct 2020 20:00:25 +0300 Subject: [PATCH] Allow plugins to access the 'threads' module for creating new threads --- src/pluginApi.js | 2 ++ src/plugins.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/pluginApi.js b/src/pluginApi.js index 4ae092d..4fdcac9 100644 --- a/src/pluginApi.js +++ b/src/pluginApi.js @@ -2,6 +2,7 @@ const express = require("express"); const { CommandManager } = require("knub-command-manager"); const { Client } = require("eris"); const Knex = require("knex"); +const threads = require("./data/threads"); /** * @typedef {object} PluginAPI @@ -14,6 +15,7 @@ const Knex = require("knex"); * @property {PluginHooksAPI} hooks * @property {FormattersExport} formats * @property {express.Application} webserver + * @property {threads} threads */ /** diff --git a/src/plugins.js b/src/plugins.js index 1d9fdd5..c0741fe 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -7,6 +7,7 @@ const { server: webserver } = require("./modules/webserver"); const childProcess = require("child_process"); const pacote = require("pacote"); const path = require("path"); +const threads = require("./data/threads"); const pluginSources = { npm: { @@ -128,6 +129,7 @@ module.exports = { }, formats, webserver, + threads, }; }, };