Chgange plugin loakder
This commit is contained in:
parent
1631d3cb9d
commit
3a76b57b33
1 changed files with 11 additions and 10 deletions
21
index.js
21
index.js
|
@ -6,17 +6,18 @@ const fs = require('fs')
|
||||||
|
|
||||||
module.exports.bot = []
|
module.exports.bot = []
|
||||||
|
|
||||||
const loadplug = (botno) => {
|
const botplug = []
|
||||||
const botplug = []
|
const bpl = fs.readdirSync('plugins')
|
||||||
const bpl = fs.readdirSync('plugins')
|
for (const i in bpl) {
|
||||||
for (const i in bpl) {
|
if (!bpl[i].endsWith('.js')) {
|
||||||
if (!bpl[i].endsWith('.js')) {
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
botplug.push(require(`./plugins/${bpl[i]}`))
|
|
||||||
} catch (e) { console.log(e) }
|
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
botplug.push(require(`./plugins/${bpl[i]}`))
|
||||||
|
} catch (e) { console.log(e) }
|
||||||
|
}
|
||||||
|
|
||||||
|
const loadplug = (botno) => {
|
||||||
botplug.forEach((plug) => {
|
botplug.forEach((plug) => {
|
||||||
try {
|
try {
|
||||||
if (plug.load) {
|
if (plug.load) {
|
||||||
|
|
Loading…
Reference in a new issue