forked from ibrahimaitech/BWM-NORMAL-BOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgreetings.js
68 lines (60 loc) · 4.09 KB
/
greetings.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//═══════════════════════════════════════════════════════//
//╔══╗ ╔╗ ╔═══╗╔═══╗╔╗╔═╗ ╔═══╗╔═══╗╔═╗ ╔╗╔════╗╔╗ ╔╗╔═══╗╔═══╗ ╔═╗╔═╗╔═══╗
//║╔╗║ ║║ ║╔═╗║║╔═╗║║║║╔╝ ║╔═╗║║╔═╗║║║╚╗║║║╔╗╔╗║║║ ║║║╔══╝║╔═╗║ ║║╚╝║║╚╗╔╗║
//║╚╝╚╗║║ ║║ ║║║║ ╚╝║╚╝╝ ║╚═╝║║║ ║║║╔╗╚╝║╚╝║║╚╝║╚═╝║║╚══╗║╚═╝║ ║╔╗╔╗║ ║║║║
//║╔═╗║║║ ╔╗║╚═╝║║║ ╔╗║╔╗║ ║╔══╝║╚═╝║║║╚╗║║ ║║ ║╔═╗║║╔══╝║╔╗╔╝ ║║║║║║ ║║║║
//║╚═╝║║╚═╝║║╔═╗║║╚═╝║║║║╚╗ ║║ ║╔═╗║║║ ║║║ ╔╝╚╗ ║║ ║║║╚══╗║║║╚╗ ║║║║║║╔╝╚╝║
//╚═══╝╚═══╝╚╝ ╚╝╚═══╝╚╝╚═╝ ╚╝ ╚╝ ╚╝╚╝ ╚═╝ ╚══╝ ╚╝ ╚╝╚═══╝╚╝╚═╝ ╚╝╚╝╚╝╚═══╝
//════════════════════════════//
let DataPack = require('sew-queen-pro');
let SewQueen = require('sew-queen-pro/sources/dc/handler');
let Details = require('sew-queen-pro/sources/dc/Details');
let { MessageType, MessageOptions, Mimetype, GroupSettingChange, ChatModification } = require('@ravindu01manoj/sew-queen-web');
let fs = require('fs');
let os = require('os');
let ffmpeg = require('fluent-ffmpeg');
let exec = require('child_process').exec;
let axios = require('axios');
let got = require('got');
let {execFile} = require('child_process');
let cwebp = require('cwebp-bin');
let DataHelp = DataPack.constdata
let WorkType = Details.WORKTYPE == 'public' ? false : true
let DataB = require('../DataBase/greetings');
let DATA = DataHelp.dataGet('greetings');
SewQueen['IntroduceCMD']({pattern: 'welcome (.*)', fromMe: true, dontAdCommandList: true}, (async (message, input) => {
if (message.reply_message) {
textsew = message.reply_message.text
} else {
if (input[1] === '') {
var hg = await DataB.getMessage(message.jid);
if (hg === false) {
return await message.client.sendMessage(message.jid,DATA.NOT_SET_WELCOME,MessageType.text);
} else {
return await message.client.sendMessage(message.jid,DATA.WELCOME_ALREADY_SETTED + hg.message + '```',MessageType.text);
}
}
textsew = input[1]
}
if (textsew === 'delete') { await message.client.sendMessage(message.jid,DATA.WELCOME_DELETED,MessageType.text); return await DataB.deleteMessage(message.jid, 'welcome'); }
await DataB.setMessage(message.jid, 'welcome', textsew.replace(/#/g, '\n'));
return await message.client.sendMessage(message.jid,DATA.WELCOME_SETTED,MessageType.text)
}));
SewQueen['IntroduceCMD']({pattern: 'goodbye (.*)', fromMe: true, dontAdCommandList: true}, (async (message, input) => {
if (message.reply_message) {
textsew = message.reply_message.text
} else {
if (input[1] === '') {
var hg = await DataB.getMessage(message.jid, 'goodbye');
if (hg === false) {
return await message.client.sendMessage(message.jid,DATA.NOT_SET_WELCOME,MessageType.text);
} else {
return await message.client.sendMessage(message.jid,DATA.GOODBYE_ALREADY_SETTED + hg.message + '```',MessageType.text);
}
}
textsew = input[1]
}
if (textsew === 'delete') { await message.client.sendMessage(message.jid,DATA.GOODBYE_DELETED,MessageType.text); return await DataB.deleteMessage(message.jid, 'goodbye'); }
await DataB.setMessage(message.jid, 'goodbye', textsew.replace(/#/g, '\n'));
return await message.client.sendMessage(message.jid,DATA.GOODBYE_SETTED,MessageType.text)
}));