forked from Maduradilshan/Dilshann-MD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbgmm.js
44 lines (34 loc) · 11.4 KB
/
bgmm.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
/**
//══════════════════════════════════════════════════════════════════════════════════════════════════════//
WHATSAPP BOT-MD BETA
V:1.0.1
██╗ ██╗ █████╗ ██╗██╗██████╗ █████╗ ███╗ ███╗██████╗
██║ ██║██╔══██╗ ██║██║██╔══██╗██╔══██╗ ████╗ ████║██╔══██╗
██║ ██║███████║ ██║██║██████╔╝███████║ █████╗██╔████╔██║██║ ██║
╚██╗ ██╔╝██╔══██║██ ██║██║██╔══██╗██╔══██║ ╚════╝██║╚██╔╝██║██║ ██║
╚████╔╝ ██║ ██║╚█████╔╝██║██║ ██║██║ ██║ ██║ ╚═╝ ██║██████╔╝
╚═══╝ ╚═╝ ╚═╝ ╚════╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝
a
//══════════════════════════════════════════════════════════════════════════════════════════════════════//
CURRENTLY RUNNING ON BETA VERSION!!
*
* @project_name : Vajira-Md
* @author : Vajira Tech Info
* @youtube : https://youtube.com/@gamingewingyt6216
* @description : Vajira-Md ,A Multi-functional whatsapp user bot.
* @version 1.2.2
*
* Licensed under the GPL-3.0 License;
*
* ┌┤Created By Vajira Tech Info.
* © 2023 Vajira-Md ✭ ⛥.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**/
if(isMongodb){const _0x3ea954=_0x1a32;(function(_0x3eff70,_0x21ee64){const _0x3da53f=_0x1a32,_0x386909=_0x3eff70();while(!![]){try{const _0x25c03a=parseInt(_0x3da53f(0x220))/0x1*(-parseInt(_0x3da53f(0x1fa))/0x2)+parseInt(_0x3da53f(0x20b))/0x3+-parseInt(_0x3da53f(0x223))/0x4*(-parseInt(_0x3da53f(0x228))/0x5)+parseInt(_0x3da53f(0x21e))/0x6*(parseInt(_0x3da53f(0x1f9))/0x7)+parseInt(_0x3da53f(0x208))/0x8+-parseInt(_0x3da53f(0x217))/0x9+-parseInt(_0x3da53f(0x229))/0xa;if(_0x25c03a===_0x21ee64)break;else _0x386909['push'](_0x386909['shift']());}catch(_0x17f992){_0x386909['push'](_0x386909['shift']());}}}(_0x37d0,0x8b701));const {TelegraPh,bgms}=require(_0x3ea954(0x211)),ffmpeg=require(_0x3ea954(0x1f5)),axios=require(_0x3ea954(0x201)),{getBuffer,smd,Config}=require(_0x3ea954(0x211)),fs=require(_0x3ea954(0x210)),util=require('util'),exec=util[_0x3ea954(0x233)](require('child_process')['exec']);function _0x1a32(_0x218ed1,_0x52cffc){const _0x37d0c6=_0x37d0();return _0x1a32=function(_0x1a3250,_0x33d20f){_0x1a3250=_0x1a3250-0x1f4;let _0x169362=_0x37d0c6[_0x1a3250];return _0x169362;},_0x1a32(_0x218ed1,_0x52cffc);}function _0x37d0(){const _0x36a601=['*Name\x20_\x27','9689283URSitj','\x20:*\x20_','*Give\x20Me\x20Song\x20Name\x20to\x20Delete\x20From\x20BGM*','bgm','findOne','addbgm','general','1482MYrRxa','enable','500249dWAupu','quoted','set','436AsrWaF','chat','ffprobe\x20-v\x20error\x20-show_entries\x20format=duration\x20-of\x20default=noprint_wrappers=1:nokey=1\x20','_\x20\x0a','*_Toggle\x20on/off\x20to\x20enable/disable\x20Bgm_*','32250BqUNgt','1942890VvjCEb','videoMessage','./convertedVideo.mp4','audioMessage','delbgm','./blackScreen.mp4','audio','reply','toLowerCase','sendMessage','promisify','*Bgm\x20Succesfully\x20enabled*','send','\x20*BGM\x20SONG\x20INFORMATION*\x0a','*Song\x20_','An\x20error\x20occurred:','fluent-ffmpeg','downloadAndSaveMediaMessage','owner','off','26341huYykt','2QJtXcJ','error','save','audio/mpeg','*New\x20Song\x20Added\x20in\x20BGM\x20with\x20Name\x20:\x20','bgmArray','Uhh\x20Please\x20give\x20Bgm\x20Song\x20NAme','axios','mtype','includes','Toggle\x20On/Off\x20to\x20enable/disable\x20bgm','There\x27s\x20an\x20Error\x20While\x20Adding\x20Bgm\x20Song','ffmpeg\x20-f\x20lavfi\x20-i\x20color=c=black:s=1280x720:d=','unlinkSync','4913944ZYyNMD','deact','create\x20paste\x20of\x20text.','286524YXQdpr','bot','Uhh\x20Please,\x20Reply\x20to\x20Audio/Video\x20To\x20Add\x20In\x20Bgm','_\x20removed\x20from\x20BGM.*','\x20-vf\x20\x22format=yuv420p\x22\x20./blackScreen.mp4','fs-extra','../lib/','*_You\x20didn\x27t\x20set\x20any\x20song\x20in\x20bgm\x20yet!!_*','Suhail-bgm','has','text'];_0x37d0=function(){return _0x36a601;};return _0x37d0();}async function convertAudioToBlackScreenVideo(_0x21894e,_0x3b05cb){const _0x5c0ac5=_0x3ea954;try{try{fs[_0x5c0ac5(0x207)](_0x3b05cb);}catch(_0x236ec5){}const _0x289fc9=_0x5c0ac5(0x225)+_0x21894e,{stdout:_0x9e5f68}=await exec(_0x289fc9),_0x135ef3=parseFloat(_0x9e5f68);try{fs[_0x5c0ac5(0x207)](_0x5c0ac5(0x22e));}catch(_0x117f0b){}const _0x294e0a=_0x5c0ac5(0x206)+_0x135ef3+_0x5c0ac5(0x20f);await exec(_0x294e0a);const _0x237292='ffmpeg\x20-i\x20./blackScreen.mp4\x20-i\x20'+_0x21894e+'\x20-c:v\x20copy\x20-c:a\x20aac\x20-map\x200:v:0\x20-map\x201:a:0\x20'+_0x3b05cb;return await exec(_0x237292),console['log']('Audio\x20converted\x20to\x20black\x20screen\x20video\x20successfully!'),{'result':!![]};}catch(_0x4745ed){return console[_0x5c0ac5(0x1fb)](_0x5c0ac5(0x1f4),_0x4745ed),{'result':![]};}}smd({'pattern':_0x3ea954(0x21a),'desc':_0x3ea954(0x204),'category':_0x3ea954(0x21d),'filename':__filename},async(_0x40ec17,_0x851f5,_0x2ad928,{isCreator:_0xb6c01a})=>{const _0x25ca0b=_0x3ea954;if(!_0xb6c01a)return await _0x851f5['send'](tlang()[_0x25ca0b(0x1f7)]);let _0x18cfce=await bgms['findOne']({'id':_0x25ca0b(0x213)})||await new bgms({'id':_0x25ca0b(0x213)})[_0x25ca0b(0x1fc)](),_0x31b045=_0x2ad928[_0x25ca0b(0x231)]()['split']()[0x0];if(_0x31b045==='on'||_0x31b045===_0x25ca0b(0x21f)||_0x31b045==='act')return _0x18cfce[_0x25ca0b(0x21a)]=!![],await _0x18cfce['save'](),await _0x851f5[_0x25ca0b(0x230)](_0x25ca0b(0x234));else{if(_0x31b045===_0x25ca0b(0x1f8)||_0x31b045==='disable'||_0x31b045===_0x25ca0b(0x209))return _0x18cfce[_0x25ca0b(0x21a)]=![],await _0x18cfce[_0x25ca0b(0x1fc)](),await _0x851f5['reply']('*Bgm\x20Succesfully\x20deactivated*');else return await _0x851f5[_0x25ca0b(0x235)](_0x25ca0b(0x227));}}),smd({'pattern':_0x3ea954(0x22d),'desc':_0x3ea954(0x20a),'category':_0x3ea954(0x21d),'filename':__filename},async(_0x14df53,_0x1518ea,_0x24fdcf,{isCreator:_0x55ca27})=>{const _0x503f98=_0x3ea954;if(!_0x55ca27)return await _0x1518ea[_0x503f98(0x235)](tlang()['owner']);if(!_0x24fdcf)return await _0x1518ea['reply'](_0x503f98(0x219));let _0x414e29=await bgms['findOne']({'id':_0x503f98(0x213)})||await new bgms({'id':_0x503f98(0x213)})[_0x503f98(0x1fc)]();return _0x414e29[_0x503f98(0x1ff)][_0x503f98(0x214)](_0x24fdcf)?(_0x414e29['bgmArray']['delete'](_0x24fdcf),await _0x414e29[_0x503f98(0x1fc)](),await _0x1518ea[_0x503f98(0x230)](_0x503f98(0x237)+_0x24fdcf+_0x503f98(0x20e))):await _0x1518ea['reply'](_0x503f98(0x216)+_0x24fdcf+'\x27_\x20does\x20not\x20exist\x20in\x20BGM.*');}),smd({'pattern':'allbgm','desc':_0x3ea954(0x20a),'category':'general','filename':__filename},async(_0x407b1a,_0x537d17,_0x583ab4,{isCreator:_0x4b36dd})=>{const _0x5eac31=_0x3ea954;if(!_0x4b36dd)return await _0x537d17[_0x5eac31(0x235)](tlang()[_0x5eac31(0x1f7)]);_0x583ab4='\x20*BGM\x20SONG\x20INFORMATION*\x0a';let _0x2bf365=await bgms[_0x5eac31(0x21b)]({'id':_0x5eac31(0x213)})||await new bgms({'id':'Suhail-bgm'})[_0x5eac31(0x1fc)]();for(const [_0x438c42,_0x52e6c6]of _0x2bf365['bgmArray']){_0x583ab4+='*'+_0x438c42+_0x5eac31(0x218)+_0x52e6c6+_0x5eac31(0x226);}return await _0x537d17['reply'](_0x583ab4===_0x5eac31(0x236)?_0x5eac31(0x212):_0x583ab4);}),smd({'pattern':_0x3ea954(0x21c),'desc':_0x3ea954(0x20a),'category':'general','filename':__filename},async(_0x57ea48,_0xa0412a,_0x315d42,{isCreator:_0x194d4b})=>{const _0x509ef0=_0x3ea954;if(!_0x194d4b)return await _0xa0412a[_0x509ef0(0x235)](tlang()[_0x509ef0(0x1f7)]);if(!_0xa0412a['quoted'])return await _0xa0412a[_0x509ef0(0x230)]('Uhh\x20Please,\x20Reply\x20to\x20Audio/Video\x20To\x20Add\x20In\x20Bgm');if(!_0x315d42)return await _0xa0412a[_0x509ef0(0x230)](_0x509ef0(0x200));let _0x587fd5=![],_0x14c9cb='';if(_0xa0412a[_0x509ef0(0x221)][_0x509ef0(0x202)]==_0x509ef0(0x22a))_0x14c9cb=await _0x57ea48[_0x509ef0(0x20c)][_0x509ef0(0x1f6)](_0xa0412a[_0x509ef0(0x221)]),_0x587fd5=!![];else{if(_0xa0412a[_0x509ef0(0x221)][_0x509ef0(0x202)]==_0x509ef0(0x22c)){_0x587fd5=![];let _0xbcd098=await _0x57ea48[_0x509ef0(0x20c)][_0x509ef0(0x1f6)](_0xa0412a[_0x509ef0(0x221)],_0x509ef0(0x22f)),_0x5a349b=await convertAudioToBlackScreenVideo(_0xbcd098,_0x509ef0(0x22b));_0x5a349b['result']&&(_0x14c9cb='./convertedVideo.mp4');}else return await _0xa0412a['reply'](_0x509ef0(0x20d));}if(!_0x14c9cb)return await _0xa0412a['reply'](_0x509ef0(0x205));let _0x1c8b77=await TelegraPh(_0x14c9cb),_0x163c5d=await bgms[_0x509ef0(0x21b)]({'id':_0x509ef0(0x213)})||await new bgms({'id':_0x509ef0(0x213)})['save']();try{return _0x163c5d[_0x509ef0(0x1ff)][_0x509ef0(0x222)](_0x315d42,_0x1c8b77),await _0x163c5d[_0x509ef0(0x1fc)](),await _0xa0412a[_0x509ef0(0x230)](_0x509ef0(0x1fe)+_0x315d42+'*');}catch(_0x2bd0df){return await _0xa0412a[_0x509ef0(0x1fb)](_0x2bd0df);}}),smd({'on':'text'},async(_0x84027c,_0x2e42fa,_0x5466e3)=>{const _0xa4854e=_0x3ea954;let _0x5d360f=await bgms[_0xa4854e(0x21b)]({'id':_0xa4854e(0x213)})||await new bgms({'id':'Suhail-bgm'})[_0xa4854e(0x1fc)]();if(_0x5d360f&&_0x5d360f[_0xa4854e(0x21a)]&&_0x2e42fa[_0xa4854e(0x215)]){let _0x3f196a='\x20'+_0x2e42fa[_0xa4854e(0x215)]+'\x20';for(const [_0x5cb69f,_0x1853c4]of _0x5d360f[_0xa4854e(0x1ff)]){_0x3f196a[_0xa4854e(0x231)]()[_0xa4854e(0x203)](_0x5cb69f+'\x20')&&await _0x2e42fa[_0xa4854e(0x232)](_0x2e42fa[_0xa4854e(0x224)],{'audio':{'url':_0x1853c4},'mimetype':_0xa4854e(0x1fd),'ptt':!![],'waveform':[0x63,0x4b,0x19,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5,0x19,0x32,0x4b,0x63,0x4b,0x32,0x19,0x0]});}}});}