-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.js
38 lines (31 loc) · 930 Bytes
/
cmd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* Codded by @Dulen Sathsara
Telegram: t.me/dulensathsara
Licensed under the GPL-3.0 License;
you may not use this file except in compliance with the License.
Whats bot - Dulen Sathsara
*/
let DataPack = require('madam-mask');
let MadamMask = require('madam-mask/sources/dc/handler');
let Details = require('madam-mask/sources/dc/Details');
const { DataTypes } = require('sequelize');
const PluginDB = Details.DATABASE.define('Plugin', {
name: {
type: DataTypes.STRING,
allowNull: false
},
url: {
type: DataTypes.TEXT,
allowNull: false
}
});
async function installPlugin(adres, file) {
var Plugin = await PluginDB.findAll({
where: {url: adres}
});
if (Plugin.length >= 1) {
return false;
} else {
return await PluginDB.create({ url: adres, name: file });
}
}
module.exports = { PluginDB: PluginDB, installPlugin: installPlugin };