@neoxr/wb 1.45.65

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.
@@ -0,0 +1,33 @@
1
+ require('dotenv').config()
2
+ const { Baileys, Scandir, InvCloud } = require('./baileys')
3
+ const Converter = new (require('../system/converter'))
4
+ const Function = new (require('../system/functions'))
5
+ const Scraper = new (require('../system/scraper'))
6
+ const MongoDB = /mongo/.test(process.env.DATABASE_URL) && process.env.DATABASE_URL ? new (require('../system/mongo')) : false
7
+ const PostgreSQL = /postgres/.test(process.env.DATABASE_URL) && process.env.DATABASE_URL ? new (require('../system/pg')) : false
8
+ const Dataset = process.env.DATABASE_URL ? new (require('../system/multidb')) : false
9
+ const Logs = require('../system/logs')
10
+ const NeoxrCommands = new (require('../system/neoxr'))
11
+ const NeoxrApi = require('@neoxr/api')
12
+ const Queue = require('../system/queue')
13
+ const Cooldown = require('../system/cooldown')
14
+ const Spam = require('../system/spamDetector')
15
+ const Translator = require('../system/translator')
16
+ module.exports = class Component {
17
+ Baileys = Baileys
18
+ Converter = Converter
19
+ Function = Function
20
+ Scraper = Scraper
21
+ MongoDB = MongoDB
22
+ PostgreSQL = PostgreSQL
23
+ Dataset = Dataset
24
+ Scandir = Scandir
25
+ InvCloud = InvCloud
26
+ Logs = Logs
27
+ NeoxrCommands = NeoxrCommands
28
+ NeoxrApi = NeoxrApi
29
+ Queue = Queue
30
+ Cooldown = Cooldown
31
+ Spam = Spam
32
+ Translator = Translator
33
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ const fs = require('fs')
3
+ const { Baileys } = new(require('@neoxr/wb'))
4
+ const client = new Baileys({
5
+ sf: 'session',
6
+ online: true,
7
+ version: [2, 2318, 11]
8
+ })
9
+ client.on('error', async error => console.log(error.message))
10
+ client.on('ready', async () => {
11
+ /* clear temp folder every 3 minutes */
12
+ setInterval(() => {
13
+ const tmpFiles = fs.readdirSync('./temp')
14
+ if (tmpFiles.length > 0) {
15
+ tmpFiles.map(v => fs.unlinkSync('./temp/' + v))
16
+ }
17
+ }, 60 * 1000 * 3)
18
+ })
19
+
20
+ /* print all message */
21
+ client.on('message', ctx => console.log(ctx))
22
+
23
+ /* print deleted message */
24
+ client.on('message.delete', ctx => ctx ? client.sock.copyNForward(ctx.chat, ctx.delete) : '')
25
+
26
+ /* other events */
27
+ client.on('group.add', ctx => console.log(ctx))
28
+ client.on('group.remove', ctx => console.log(ctx))
29
+ client.on('group.promote', ctx => console.log(ctx))
30
+ client.on('group.demote', ctx => console.log(ctx))
31
+ client.on('caller', ctx => console.log(ctx))
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "example",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "@adiwajshing/keyed-db": "^0.2.4",
14
+ "@neoxr/wb": "^1.9.7",
15
+ "baileys": "6.0.7"
16
+ }
17
+ }
File without changes