queen_amdi_core 1.2.9 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/language/applyLANG.js +1 -1
- package/package.json +1 -1
- package/plugins/Readme.md +13 -0
- package/plugins/_amdi_menu.js +54 -0
- package/plugins/_anti_functions.js +67 -0
- package/plugins/_bot_control.js +242 -0
- package/plugins/_onTEXT.js +29 -0
- package/plugins/apkdl.js +116 -0
- package/plugins/ban.js +61 -0
- package/plugins/deleteMsg.js +73 -0
- package/plugins/downloadSocialMedia.js +130 -0
- package/plugins/downloadYT.js +187 -0
- package/plugins/editor.js +43 -0
- package/plugins/fancy.js +39 -0
- package/plugins/greetings.js +127 -0
- package/plugins/grpManager.js +264 -0
- package/plugins/info.js +85 -0
- package/plugins/misc.js +239 -0
- package/plugins/search.js +83 -0
- package/plugins/settings.js +43 -0
- package/plugins/stickers.js +205 -0
- package/plugins/system_status.js +59 -0
- package/plugins/tags.js +89 -0
- package/plugins/votepolls.js +27 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
/**
|
2
|
+
* @project_name Queen Amdi [WA Multi-device]
|
3
|
+
* @author BlackAmda <https://github.com/BlackAmda>
|
4
|
+
* @description A WhatsApp based 3ʳᵈ party application that provide many services with a real-time automated conversational experience
|
5
|
+
* @link <https://github.com/BlackAmda/QueenAmdi>
|
6
|
+
* @version 4.0.5
|
7
|
+
* @file deleteMsg.js - QueenAmdi bot/group/user message remover
|
8
|
+
|
9
|
+
© 2022 Black Amda, ANTECH. All rights reserved.
|
10
|
+
Licensed under the GPL-3.0 License;
|
11
|
+
you may not use this file except in compliance with the License.*/
|
12
|
+
|
13
|
+
const { AMDI, amdiDB, ban, deleteMsg, Language } = require('queen_amdi_core/dist/scripts')
|
14
|
+
const { getSettings } = amdiDB.settingsDB
|
15
|
+
const { setDelAllJids, getlistDelAllJids } = amdiDB.ban_jidDB
|
16
|
+
const { GRP_deleteMsg } = deleteMsg
|
17
|
+
const Lang = Language.getString('deleteMsg');
|
18
|
+
|
19
|
+
|
20
|
+
AMDI({ cmd: "del", desc: Lang.delDesc, type: "profile" }, (async (amdiWA) => {
|
21
|
+
let { botNumberJid, isGroup, isReply, reply, isTagMe, isTagOwner, deleteKEY } = amdiWA.msgLayout;
|
22
|
+
|
23
|
+
if (!isReply) return reply(Lang.needReplymsg)
|
24
|
+
if (isTagOwner) return reply(Lang.noBanOwners);
|
25
|
+
|
26
|
+
if (isGroup) {
|
27
|
+
return await GRP_deleteMsg(amdiWA);
|
28
|
+
} else if (!isGroup) {
|
29
|
+
if (!isTagMe) return;
|
30
|
+
const options = {
|
31
|
+
remoteJid: botNumberJid,
|
32
|
+
fromMe: true,
|
33
|
+
id: amdiWA.msg.message.extendedTextMessage.contextInfo.stanzaId
|
34
|
+
}
|
35
|
+
return await deleteKEY(options.key);
|
36
|
+
}
|
37
|
+
}));
|
38
|
+
|
39
|
+
|
40
|
+
AMDI({ cmd: "delall", desc: Lang.delAllDesc, type: "admin" }, (async (amdiWA) => {
|
41
|
+
let { botNumberJid, input, isGroup, reply, isReply, allowedNumbs, sendText, taggedJid } = amdiWA.msgLayout;
|
42
|
+
|
43
|
+
if (!isGroup) return reply(Lang.notGRP, "❌");
|
44
|
+
if (!amdiWA.msg.message.extendedTextMessage) return reply(Lang.giveUSER, "❌");
|
45
|
+
|
46
|
+
const setMODS = await getSettings('MODERATOR')
|
47
|
+
const MOD = setMODS.input
|
48
|
+
if (taggedJid == botNumberJid) return reply(Lang.noBanMe);
|
49
|
+
if (allowedNumbs.includes(taggedJid.split('@')[0])) return reply(Lang.noDelAllOwners);
|
50
|
+
if (MOD.includes(taggedJid.split('@')[0])) return reply(Lang.noBanAllMod);
|
51
|
+
|
52
|
+
let num_split = taggedJid.split("@s.whatsapp.net")[0];
|
53
|
+
let warnMsg = `*@${num_split} ,${Lang.banMsg}*`;
|
54
|
+
//await amdiWA.web.sendMessage(amdiWA.clientJID, { sticker: {url: 'https://i.ibb.co/8m0sGwz/lolwennayanne.webp'} });
|
55
|
+
await sendText(warnMsg, {mentionJIDS: [taggedJid], quoted: true, reactEmoji: "☠️"});
|
56
|
+
return await setDelAllJids(taggedJid, 'User: +' + taggedJid.split('@')[0], amdiWA.clientJID);
|
57
|
+
}));
|
58
|
+
|
59
|
+
|
60
|
+
AMDI({ cmd: "listdel", desc: Lang.listdelAllDesc, type: "admin", react: "📓" }, (async (amdiWA) => {
|
61
|
+
let { prefix, reply, sendListMsg } = amdiWA.msgLayout;
|
62
|
+
|
63
|
+
var listInfo = {}
|
64
|
+
listInfo.title = Lang.delListTitle
|
65
|
+
listInfo.text = Lang.delListText
|
66
|
+
listInfo.buttonTXT = 'default'
|
67
|
+
|
68
|
+
const delList = await getlistDelAllJids(amdiWA.clientJID);
|
69
|
+
const rows = await ban.delRows(prefix, delList)
|
70
|
+
if (rows == '') return await reply('*No delete all messags JIDs for this group*', "🙂");
|
71
|
+
const sections = [{ title: "Delete All Messages JIDs list", rows: rows }]
|
72
|
+
return await sendListMsg(listInfo, sections);
|
73
|
+
}));
|
@@ -0,0 +1,130 @@
|
|
1
|
+
/**
|
2
|
+
* @project_name Queen Amdi [WA Multi-device]
|
3
|
+
* @author BlackAmda <https://github.com/BlackAmda>
|
4
|
+
* @description A WhatsApp based 3ʳᵈ party application that provide many services with a real-time automated conversational experience
|
5
|
+
* @link <https://github.com/BlackAmda/QueenAmdi>
|
6
|
+
* @version 4.0.5
|
7
|
+
* @file downloadSocialMedia.js - QueenAmdi Social Media downloaders
|
8
|
+
|
9
|
+
© 2022 Black Amda, ANTECH. All rights reserved.
|
10
|
+
Licensed under the GPL-3.0 License;
|
11
|
+
you may not use this file except in compliance with the License.*/
|
12
|
+
|
13
|
+
const { AMDI, blackamda_API, _default, igDownloader, Language, tiktok, web_scrapers } = require('queen_amdi_core/dist/scripts')
|
14
|
+
const { fblogo } = _default
|
15
|
+
const { fbDownloader } = web_scrapers
|
16
|
+
const axios = require("axios")
|
17
|
+
const Lang = Language.getString('downloadSocialMedia');
|
18
|
+
|
19
|
+
AMDI({ cmd: ["fb", "facebook"], desc: Lang.fbDesc, example: Lang.fbEXA, type: "download", react: "🎥" }, (async (amdiWA) => {
|
20
|
+
let { input, isFBurl, reply, sendButtonsMsg } = amdiWA.msgLayout;
|
21
|
+
|
22
|
+
if (!isFBurl(input)) return reply(Lang.needlink, '❓');
|
23
|
+
|
24
|
+
const fbdl_data = await fbDownloader(amdiWA);
|
25
|
+
|
26
|
+
if (!fbdl_data.hd && !fbdl_data.sd) return await reply(Lang.notfound, "❌");
|
27
|
+
const thumb = fbdl_data.thumbnail ? fbdl_data.thumbnail : fblogo
|
28
|
+
return await sendButtonsMsg([fbdl_data.hd, fbdl_data.sd], { text: `🎥 *Facebook video downloader*\n\n\`\`\`${fbdl_data.title}\`\`\``, image: { url: thumb }, tagMsg: true, noTemplate: 1 });
|
29
|
+
}));
|
30
|
+
|
31
|
+
|
32
|
+
AMDI({ cmd: ["ig", "insta", "instagram"], desc: Lang.igDesc, example: Lang.igEXA, type: "download", react: "🌀" }, (async (amdiWA) => {
|
33
|
+
let { footerTXT, input, isLINK, isIGurl, react, reply, sendImage, sendVideo } = amdiWA.msgLayout;
|
34
|
+
|
35
|
+
if (!isLINK(input)) return reply(Lang.needlink, '❓');
|
36
|
+
if (!isIGurl(input)) return reply(Lang.needvalidIG);
|
37
|
+
|
38
|
+
await react("⬇️");
|
39
|
+
try {
|
40
|
+
var igPost = await igDownloader(input);
|
41
|
+
if (!igPost.length) return await reply(Lang.notfound, "❌");
|
42
|
+
if (!igPost[0].url) return await reply("Error".fetchError(igPost.type), "❌", 1);
|
43
|
+
|
44
|
+
await react("⬆️");
|
45
|
+
igPost.forEach(async (data) => {
|
46
|
+
if (data.type === 'image') { await sendImage({ url: data.url }, { caption: footerTXT, quoted: true }); }
|
47
|
+
else if (data.type === 'video') { await sendVideo({ url: data.url }, { caption: footerTXT, quoted: true }); }
|
48
|
+
});
|
49
|
+
return await react("✔️");
|
50
|
+
} catch (e) {
|
51
|
+
console.log(e);
|
52
|
+
return await reply("Error".fetchError(e), "❌", 1);
|
53
|
+
}
|
54
|
+
}));
|
55
|
+
|
56
|
+
|
57
|
+
AMDI({ cmd: ["tk", "tiktok"], desc: Lang.TKDESC, example: Lang.tkEXA, type: "download", react: "🏳️🌈" }, (async (amdiWA) => {
|
58
|
+
let { input, prefix, reply, sendListMsg } = amdiWA.msgLayout;
|
59
|
+
|
60
|
+
if (!input) return await reply(Lang.needlink, '❓');
|
61
|
+
if (!input.includes('tiktok.com/')) return await reply(Lang.needlink, '❓');
|
62
|
+
|
63
|
+
const tkData = await tiktok({ url: input });
|
64
|
+
|
65
|
+
const TKText = `\`\`\`${tkData.video.signature}\`\`\`\n\n🎵 Music: ${tkData.audio.name}\n\n👨🏻🎤 Author: ${tkData.owner.name}\n\n👤 Username: ${tkData.owner.username}`
|
66
|
+
|
67
|
+
const sections = [
|
68
|
+
{
|
69
|
+
title: "Tiktok Information",
|
70
|
+
rows: [
|
71
|
+
{ title: "ℹ️ Tiktok Information", rowId: `${prefix}tkinfo ${input}` }
|
72
|
+
]
|
73
|
+
},
|
74
|
+
{
|
75
|
+
title: "Tiktok Video",
|
76
|
+
rows: [
|
77
|
+
{ title: "🔖 With Watermark", rowId: `${prefix}tkdl mark ${input}` },
|
78
|
+
{ title: "📼 No-Watermark", rowId: `${prefix}tkdl nomark ${input}` }
|
79
|
+
]
|
80
|
+
},
|
81
|
+
{
|
82
|
+
title: "Tiktok Audio",
|
83
|
+
rows: [
|
84
|
+
{ title: "🎶 Audio File", rowId: `${prefix}tkdl audio ${input}` },
|
85
|
+
{ title: "📁 Document File", rowId: `${prefix}tkdl doc ${input}` }
|
86
|
+
]
|
87
|
+
}
|
88
|
+
]
|
89
|
+
|
90
|
+
var listInfo = {}
|
91
|
+
listInfo.title = "🎞️ Tiktok Downloader"
|
92
|
+
listInfo.text = TKText
|
93
|
+
listInfo.buttonTXT = "Download now"
|
94
|
+
|
95
|
+
return await sendListMsg(listInfo, sections);
|
96
|
+
}));
|
97
|
+
|
98
|
+
|
99
|
+
AMDI({ cmd: ["mediafire", "mf", "mfire"], desc: Lang.MEDIAFIRE_DESC, type: "download", react: "🔥" }, (async (amdiWA) => {
|
100
|
+
let { footerTXT, input, react, reply, sendDocument } = amdiWA.msgLayout;
|
101
|
+
|
102
|
+
if (!input || !input.startsWith('https://www.mediafire.com/')) return await reply(Lang.NEED_MEDIAFIRE, "❓");
|
103
|
+
|
104
|
+
try {
|
105
|
+
await react("⬇️");
|
106
|
+
const mfAPI = await blackamda_API("mediafire", `url=${input}`, amdiWA.botNumberJid);
|
107
|
+
const response = await axios.get(mfAPI);
|
108
|
+
const json = response.data
|
109
|
+
|
110
|
+
if (json.status.error) return await reply("Error".fetchError([{ message: json.status.message }]), "❌", 1);
|
111
|
+
if (json.size.isLarge) return await reply(Lang.OVER_WA_FILE);
|
112
|
+
|
113
|
+
const caption = `${Lang.MF_TITLE}
|
114
|
+
|
115
|
+
📁 File name: ${json.name}
|
116
|
+
🎚️ Size: ${json.size}
|
117
|
+
🆙 Uploaded At: ${json.uploadedAt}
|
118
|
+
|
119
|
+
${footerTXT}`
|
120
|
+
|
121
|
+
await react("⬆️");
|
122
|
+
await sendDocument({ url: json.dl_link }, { mimetype: json.mime, fileName: json.name, caption: caption, quoted: true })
|
123
|
+
.then(async () => {
|
124
|
+
return await react("✔️");
|
125
|
+
});
|
126
|
+
} catch (e) {
|
127
|
+
console.log(e);
|
128
|
+
return await reply("Error".fetchError(e), "❌", 1);
|
129
|
+
}
|
130
|
+
}));
|
@@ -0,0 +1,187 @@
|
|
1
|
+
/**
|
2
|
+
* @project_name Queen Amdi [WA Multi-device]
|
3
|
+
* @author BlackAmda <https://github.com/BlackAmda>
|
4
|
+
* @description A WhatsApp based 3ʳᵈ party application that provide many services with a real-time automated conversational experience
|
5
|
+
* @link <https://github.com/BlackAmda/QueenAmdi>
|
6
|
+
* @version 4.0.5
|
7
|
+
* @file downloadYT.js - QueenAmdi YouTube downloader
|
8
|
+
|
9
|
+
© 2022 Black Amda, ANTECH. All rights reserved.
|
10
|
+
Licensed under the GPL-3.0 License;
|
11
|
+
you may not use this file except in compliance with the License.*/
|
12
|
+
|
13
|
+
const { AMDI, Language, youtubeDL } = require('queen_amdi_core/dist/scripts')
|
14
|
+
const { songList, videoList, sendYTaudio, sendYTdocument, sendYT720, sendYT480, sendYT360, shortVID, shortAUD } = youtubeDL
|
15
|
+
const svdl = require("@blackamda/song_video_dl")
|
16
|
+
const ytdl = require('ytdl-core');
|
17
|
+
const yts = require('yt-search');
|
18
|
+
const Lang = Language.getString('downloadYT');
|
19
|
+
|
20
|
+
AMDI({ cmd: ["song", "yta", "mp3"], desc: Lang.songDesc, example: Lang.songExa, type: "download", react: "🎵" }, (async (amdiWA) => {
|
21
|
+
let { input, prefix, reply, sendButtonsMsg, sendListMsg } = amdiWA.msgLayout;
|
22
|
+
|
23
|
+
if (!input) return reply(Lang.needYTLink, '❓')
|
24
|
+
if (input.includes('playlist')) return reply(Lang.noPL)
|
25
|
+
|
26
|
+
if (input.includes('shorts')) {
|
27
|
+
const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/
|
28
|
+
const isYT = ytIdRegex.exec(input)
|
29
|
+
if (!isYT) return reply(Lang.needYTLink, '❓')
|
30
|
+
return await shortAUD(amdiWA, input);
|
31
|
+
}
|
32
|
+
|
33
|
+
const findYT = async (name) => {
|
34
|
+
const search = await yts(name)
|
35
|
+
return search.all;
|
36
|
+
}
|
37
|
+
|
38
|
+
if (!input.includes('https://')) {
|
39
|
+
const ytVidList = await findYT(input)
|
40
|
+
var listInfo = {}
|
41
|
+
listInfo.title = Lang.songListTitle
|
42
|
+
listInfo.text = Lang.songListTXT
|
43
|
+
listInfo.buttonTXT = 'Choose a song'
|
44
|
+
|
45
|
+
try {
|
46
|
+
const sections = await songList(prefix, ytVidList);
|
47
|
+
return await sendListMsg(listInfo, sections)
|
48
|
+
} catch (e) {
|
49
|
+
return await reply(Lang.noSearch)
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
if (input.includes('https://')) {
|
54
|
+
const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/
|
55
|
+
const isYT = ytIdRegex.exec(input)
|
56
|
+
if (!isYT) return reply(Lang.needYTLink, '❓')
|
57
|
+
|
58
|
+
const ytVidList = await findYT(input);
|
59
|
+
const title = ytVidList[0] ? ytVidList[0].title : ''
|
60
|
+
const ytDlTXT = `*🎶 Queen Amdi YT Downloader*\n\n📄 ${Lang.Title} ${title}`
|
61
|
+
|
62
|
+
const buttons = [
|
63
|
+
{type: "url", displayText: "Watch on YouTube", url: input},
|
64
|
+
{type: "click", displayText: "🎶 Audio File", buttonCMD: `${prefix}ytdownload audio ${input}`},
|
65
|
+
{type: "click", displayText: "📁 Document File", buttonCMD: `${prefix}ytdownload document ${input}`},
|
66
|
+
{type: "click", displayText: "ℹ️ Video Info", buttonCMD: `${prefix}ytinfo ${input}`}
|
67
|
+
]
|
68
|
+
|
69
|
+
return await sendButtonsMsg(buttons, {text: ytDlTXT, tagMsg: true, showURL: true});
|
70
|
+
}
|
71
|
+
}));
|
72
|
+
|
73
|
+
|
74
|
+
AMDI({ cmd: ["video", "ytv", "mp4"], desc: Lang.videoDesc, example: Lang.videoExa, type: "download", react: "🎞️" }, (async (amdiWA) => {
|
75
|
+
let { input, prefix, reply, sendButtonsMsg, sendListMsg } = amdiWA.msgLayout;
|
76
|
+
|
77
|
+
if (!input) return reply(Lang.needYTLink, '❓')
|
78
|
+
if (input.includes('playlist')) return reply(Lang.noPL)
|
79
|
+
|
80
|
+
if (input.includes('shorts')) {
|
81
|
+
const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/
|
82
|
+
const isYT = ytIdRegex.exec(input)
|
83
|
+
if (!isYT) return reply(Lang.needYTLink, '❓')
|
84
|
+
return await shortVID(amdiWA, input);
|
85
|
+
}
|
86
|
+
|
87
|
+
const findYT = async (name) => {
|
88
|
+
const search = await yts(`${name}`)
|
89
|
+
return search.all;
|
90
|
+
}
|
91
|
+
|
92
|
+
if (!input.includes('https://')) {
|
93
|
+
const ytVidList = await findYT(input)
|
94
|
+
var listInfo = {}
|
95
|
+
listInfo.title = Lang.videoListTitle
|
96
|
+
listInfo.text = Lang.videoListTXT
|
97
|
+
listInfo.buttonTXT = 'Choose a video'
|
98
|
+
|
99
|
+
try {
|
100
|
+
const sections = await videoList(prefix, ytVidList);
|
101
|
+
return await sendListMsg(listInfo, sections)
|
102
|
+
} catch (e) {
|
103
|
+
return await reply(Lang.noSearch)
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
if (input.includes('https://')) {
|
108
|
+
const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/
|
109
|
+
const isYT = ytIdRegex.exec(input)
|
110
|
+
if (!isYT) return reply(Lang.needYTLink, '❓')
|
111
|
+
|
112
|
+
const ytVidList = await findYT(input)
|
113
|
+
const title = ytVidList[0] ? ytVidList[0].title : ''
|
114
|
+
const ytDlTXT = `*🎞️ Queen Amdi YT Downloader*\n\n📄 ${Lang.Title} ${title}`
|
115
|
+
|
116
|
+
const buttons = [
|
117
|
+
{type: "url", displayText: "Watch on YouTube", url: input},
|
118
|
+
{type: "click", displayText: "360p Quality", buttonCMD: `${prefix}ytdownload 360 ${input}`},
|
119
|
+
{type: "click", displayText: "480p Quality", buttonCMD: `${prefix}ytdownload 480 ${input}`},
|
120
|
+
{type: "click", displayText: "720p Quality", buttonCMD: `${prefix}ytdownload 720 ${input}`}
|
121
|
+
]
|
122
|
+
|
123
|
+
return await sendButtonsMsg(buttons, {text: ytDlTXT, tagMsg: true, showURL: true});
|
124
|
+
}
|
125
|
+
}));
|
126
|
+
|
127
|
+
|
128
|
+
AMDI({ cmd: "ytinfo", desc: Lang.YTINFO, type: "primary", react: "ℹ️" }, (async (amdiWA) => {
|
129
|
+
let { input, reply, sendImage } = amdiWA.msgLayout;
|
130
|
+
|
131
|
+
if (!input) return reply(Lang.needYTLink, '❓')
|
132
|
+
if (input.includes('playlist')) return reply(Lang.noPL)
|
133
|
+
|
134
|
+
const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/
|
135
|
+
const isYT = ytIdRegex.exec(input)
|
136
|
+
if (!isYT) return reply(Lang.needYTLink, '❓')
|
137
|
+
|
138
|
+
const findYT = async (name) => {
|
139
|
+
const search = await yts(`${name}`)
|
140
|
+
return search.all;
|
141
|
+
}
|
142
|
+
|
143
|
+
const ytdlInfo = {};
|
144
|
+
try {
|
145
|
+
let ytVidInfo = await yts( { videoId: isYT[1] } )
|
146
|
+
try { like = ytVidInfo.likes.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") } catch { like = '_Unable to get likes count_' }
|
147
|
+
ytdlInfo.ytDlTXT = `📄 ${Lang.Title} ${ytVidInfo.title}\n\n` +
|
148
|
+
`👁️ ${Lang.Views} ${ytVidInfo.views.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}\n\n` +
|
149
|
+
`👍🏻 ${Lang.Likes} ${like}\n\n` +
|
150
|
+
`🎛️ ${Lang.Channel} ${ytVidInfo.author.name}\n\n` +
|
151
|
+
`ℹ️ ${Lang.Category} ${ytVidInfo.genre}\n\n` +
|
152
|
+
`📖 ${Lang.Description}\n${ytVidInfo.description}`
|
153
|
+
try { ytdlInfo.thumb = ytVidInfo.image } catch { ytdlInfo.thumb = ytVidInfo.thumbnail }
|
154
|
+
} catch (e) {
|
155
|
+
console.log(e)
|
156
|
+
const ytVidList = await findYT(input);
|
157
|
+
ytdlInfo.ytDlTXT = `📄 ${Lang.Title} ${ytVidList[0].title}\n\n`
|
158
|
+
}
|
159
|
+
|
160
|
+
const image = ytdlInfo.thumb ? {url: ytdlInfo.thumb} : undefined;
|
161
|
+
return await sendImage(image, { quoted: true, caption: ytdlInfo.ytDlTXT });
|
162
|
+
}));
|
163
|
+
|
164
|
+
|
165
|
+
AMDI({ cmd: "ytdownload", cmdHideInMenu: true, type: "download" }, (async (amdiWA) => {
|
166
|
+
let { inputObj } = amdiWA.msgLayout;
|
167
|
+
|
168
|
+
if (inputObj[0] === "audio") {
|
169
|
+
return await sendYTaudio(amdiWA, inputObj[1])
|
170
|
+
}
|
171
|
+
|
172
|
+
if (inputObj[0] === "document") {
|
173
|
+
return await sendYTdocument(amdiWA, inputObj[1])
|
174
|
+
}
|
175
|
+
|
176
|
+
if (inputObj[0] === "720") {
|
177
|
+
return await sendYT720(amdiWA, inputObj[1])
|
178
|
+
}
|
179
|
+
|
180
|
+
if (inputObj[0] === "480") {
|
181
|
+
return await sendYT480(amdiWA, inputObj[1])
|
182
|
+
}
|
183
|
+
|
184
|
+
if (inputObj[0] === "360") {
|
185
|
+
return await sendYT360(amdiWA, inputObj[1])
|
186
|
+
}
|
187
|
+
}));
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/**
|
2
|
+
* @project_name Queen Amdi [WA Multi-device]
|
3
|
+
* @author BlackAmda <https://github.com/BlackAmda>
|
4
|
+
* @description A WhatsApp based 3ʳᵈ party application that provide many services with a real-time automated conversational experience
|
5
|
+
* @link <https://github.com/BlackAmda/QueenAmdi>
|
6
|
+
* @version 4.0.5
|
7
|
+
* @file editor.js - QueenAmdi editors
|
8
|
+
|
9
|
+
© 2022 Black Amda, ANTECH. All rights reserved.
|
10
|
+
Licensed under the GPL-3.0 License;
|
11
|
+
you may not use this file except in compliance with the License.*/
|
12
|
+
|
13
|
+
const { AMDI, ffmpeg, Language } = require('queen_amdi_core/dist/scripts')
|
14
|
+
const fs = require('fs');
|
15
|
+
const extractAudio = ffmpeg;
|
16
|
+
const getRandom = (ext) => { return `${Math.floor(Math.random() * 10000)}${ext}` };
|
17
|
+
const Lang = Language.getString('editor');
|
18
|
+
|
19
|
+
AMDI({ cmd: "getaudio", desc: Lang.GETAUDIODESC, type: "primary", react: "🎚️" }, (async (amdiWA) => {
|
20
|
+
let { clearMedia, downloadMedia, input, isMedia, isTaggedOneTimeVideo, isTaggedVideo, react, reply, reply_message, sendDocument } = amdiWA.msgLayout;
|
21
|
+
|
22
|
+
const media = await downloadMedia();
|
23
|
+
if ((isTaggedOneTimeVideo) || (isMedia && (amdiWA.msg.message.videoMessage || media.ext == 'mp4')) || (isTaggedVideo && (media.ext == 'mp4' || reply_message.videoMessage))) {
|
24
|
+
try {
|
25
|
+
await react("⬇️");
|
26
|
+
let mp3name = input ? `${input}.mp3` : `QueenAmdi-Extract-Audio-${getRandom('.mp3')}`
|
27
|
+
await extractAudio({
|
28
|
+
input: media.file,
|
29
|
+
output: mp3name
|
30
|
+
});
|
31
|
+
await react("🔄️");
|
32
|
+
await sendDocument(fs.readFileSync(mp3name), {quoted: true, mimetype: 'audio/mpeg', fileName: mp3name});
|
33
|
+
fs.unlinkSync(mp3name)
|
34
|
+
await react("✔️");
|
35
|
+
} catch (e) {
|
36
|
+
console.log(e);
|
37
|
+
await reply("Error".fetchError(e), "❌", 1);
|
38
|
+
}
|
39
|
+
} else {
|
40
|
+
await reply(Lang.GiveVideo, "❗");
|
41
|
+
}
|
42
|
+
return clearMedia(media.file);
|
43
|
+
}));
|
package/plugins/fancy.js
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* @project_name Queen Amdi [WA Multi-device]
|
3
|
+
* @author BlackAmda <https://github.com/BlackAmda>
|
4
|
+
* @description A WhatsApp based 3ʳᵈ party application that provide many services with a real-time automated conversational experience
|
5
|
+
* @link <https://github.com/BlackAmda/QueenAmdi>
|
6
|
+
* @version 4.0.5
|
7
|
+
* @file fancy.js - QueenAmdi fancy text generator
|
8
|
+
|
9
|
+
© 2022 Black Amda, ANTECH. All rights reserved.
|
10
|
+
Licensed under the GPL-3.0 License;
|
11
|
+
you may not use this file except in compliance with the License.*/
|
12
|
+
|
13
|
+
const { AMDI, fancy, Language } = require('queen_amdi_core/dist/scripts')
|
14
|
+
const {FancyText, fancyList} = fancy;
|
15
|
+
const Lang = Language.getString('fancy');
|
16
|
+
|
17
|
+
AMDI({ cmd: "fancy", desc: Lang.FONT_DESC, type: "primary", react: "🌈" }, (async (amdiWA) => {
|
18
|
+
let { input, prefix, reply, sendListMsg } = amdiWA.msgLayout;
|
19
|
+
|
20
|
+
if (!input) return reply(Lang.NEED_WORD)
|
21
|
+
|
22
|
+
var listInfo = {}
|
23
|
+
listInfo.title = '╔═══════❪💃🏻♥️❫\n\n▷ *Queen Amdi Fancy Text* ◁'
|
24
|
+
listInfo.text = 'CODED BY BLACK AMDA & RAVINDU MANOJ\n\n╚═════≪ •❈• ≫═════'
|
25
|
+
listInfo.buttonTXT = 'Select text style'
|
26
|
+
|
27
|
+
var list = await fancyList(prefix, input)
|
28
|
+
return await sendListMsg(listInfo, list);
|
29
|
+
}));
|
30
|
+
|
31
|
+
|
32
|
+
AMDI({ cmd: "textfancy", type: "primary", cmdHideInMenu: true }, (async (amdiWA) => {
|
33
|
+
let { input, sendClipboard } = amdiWA.msgLayout;
|
34
|
+
|
35
|
+
var text = input.split('////')[1]
|
36
|
+
var type = input.split('////')[0]
|
37
|
+
var out = await FancyText(text)
|
38
|
+
return await sendClipboard({text: `\n${out[type]}\n`, clip: out[type], reactEmoji: '🦄'});
|
39
|
+
}));
|
@@ -0,0 +1,127 @@
|
|
1
|
+
/**
|
2
|
+
* @project_name Queen Amdi [WA Multi-device]
|
3
|
+
* @author BlackAmda <https://github.com/BlackAmda>
|
4
|
+
* @description A WhatsApp based 3ʳᵈ party application that provide many services with a real-time automated conversational experience
|
5
|
+
* @link <https://github.com/BlackAmda/QueenAmdi>
|
6
|
+
* @version 4.0.5
|
7
|
+
* @file greetings.js - QueenAmdi group greeting messages generator
|
8
|
+
|
9
|
+
© 2022 Black Amda, ANTECH. All rights reserved.
|
10
|
+
Licensed under the GPL-3.0 License;
|
11
|
+
you may not use this file except in compliance with the License.*/
|
12
|
+
|
13
|
+
const { AMDI, amdiDB, Language } = require('queen_amdi_core/dist/scripts')
|
14
|
+
let { img2url } = require('@blackamda/telegram-image-url')
|
15
|
+
const { writeFile } = require('fs/promises');
|
16
|
+
const { setWelcome, removeWelcome, getWelcome, setBye, removeBye, getBye } = amdiDB.greetingsDB
|
17
|
+
const Lang = Language.getString('greetings');
|
18
|
+
|
19
|
+
const getFileName = (ext) => { return `${Math.floor(Math.random() * 10000)}${ext}` };
|
20
|
+
|
21
|
+
|
22
|
+
AMDI({ cmd: "setwelcome", desc: Lang.setwelDesc, example: Lang.setwelEx, type: "admin", react: "➕" }, (async (amdiWA) => {
|
23
|
+
let { clearMedia, downloadMedia, isGroup, isReply, reply, reply_message, replied_text } = amdiWA.msgLayout;
|
24
|
+
|
25
|
+
if (!isGroup) return reply(Lang.notGrp)
|
26
|
+
|
27
|
+
if (!isReply) return reply(Lang.needReplymsg)
|
28
|
+
|
29
|
+
if (reply_message.imageMessage) {
|
30
|
+
if (!reply_message.imageMessage.caption) return reply(Lang.needCaption)
|
31
|
+
|
32
|
+
const filename = await downloadMedia();
|
33
|
+
const imgURL = await img2url(filename.file)
|
34
|
+
|
35
|
+
var note = ''
|
36
|
+
if (!reply_message.imageMessage.caption.includes('#')) {
|
37
|
+
note = reply_message.imageMessage.caption
|
38
|
+
} else if (reply_message.imageMessage.caption.includes('#')) {
|
39
|
+
note = reply_message.imageMessage.caption.replace(/#/g, '\n')
|
40
|
+
}
|
41
|
+
await setWelcome(amdiWA.clientJID, note, imgURL)
|
42
|
+
await reply(Lang.WelcomSetted, "✅");
|
43
|
+
return clearMedia(filename.file);
|
44
|
+
} else {
|
45
|
+
const imgURL = 'https://i.ibb.co/XCfhtfH/301820a4f3c0.jpg'
|
46
|
+
const note = replied_text
|
47
|
+
await setWelcome(amdiWA.clientJID, note, imgURL)
|
48
|
+
return await reply(Lang.WelcomSetted, "✅");
|
49
|
+
}
|
50
|
+
}));
|
51
|
+
|
52
|
+
|
53
|
+
AMDI({ cmd: "getwelcome", desc: Lang.getwelDesc, type: "admin", react: "📘" }, (async (amdiWA) => {
|
54
|
+
let { isGroup, reply, sendImage } = amdiWA.msgLayout;
|
55
|
+
|
56
|
+
if (!isGroup) return;
|
57
|
+
let weldata = await getWelcome(amdiWA.clientJID)
|
58
|
+
if (weldata == -1 || weldata.welnote == 'blank') return reply(Lang.nowelset)
|
59
|
+
|
60
|
+
return await sendImage({ url: weldata.welpicurl }, {caption: '🔗 *Image URL :* \n' + weldata.welpicurl + '\n\n📄 *Welcome note :* \n' + weldata.welnote, quoted: true, reactEmoji: "📖"});
|
61
|
+
}));
|
62
|
+
|
63
|
+
|
64
|
+
AMDI({ cmd: "delwelcome", desc: Lang.delwelDesc, type: "admin", react: "🚮" }, (async (amdiWA) => {
|
65
|
+
let { isGroup, reply, react } = amdiWA.msgLayout;
|
66
|
+
|
67
|
+
if (!isGroup) return;
|
68
|
+
let weldata = await getWelcome(amdiWA.clientJID)
|
69
|
+
if (weldata == -1 || weldata.welnote == 'blank') return reply(Lang.nowelset)
|
70
|
+
|
71
|
+
await removeWelcome(amdiWA.clientJID)
|
72
|
+
return await reply(Lang.WelcomeDeleted, "✅");
|
73
|
+
}));
|
74
|
+
|
75
|
+
|
76
|
+
AMDI({ cmd: "setbye", desc: Lang.setbyeDesc, example: Lang.setbyeEx, type: "admin", react: "➕" }, (async (amdiWA) => {
|
77
|
+
let { clearMedia, downloadMedia, isGroup, isReply, reply, reply_message, replied_text } = amdiWA.msgLayout;
|
78
|
+
|
79
|
+
if (!isGroup) return reply(Lang.notGrp)
|
80
|
+
|
81
|
+
if (!isReply) return reply(Lang.needReplymsg)
|
82
|
+
|
83
|
+
if (reply_message.imageMessage) {
|
84
|
+
if (!reply_message.imageMessage.caption) return reply(Lang.needCaption_)
|
85
|
+
|
86
|
+
const filename = await downloadMedia();
|
87
|
+
const imgURL = await img2url(filename.file)
|
88
|
+
|
89
|
+
var note = ''
|
90
|
+
if (!reply_message.imageMessage.caption.includes('#')) {
|
91
|
+
note = reply_message.imageMessage.caption
|
92
|
+
} else if (reply_message.imageMessage.caption.includes('#')) {
|
93
|
+
note = reply_message.imageMessage.caption.replace(/#/g, '\n')
|
94
|
+
}
|
95
|
+
await setBye(amdiWA.clientJID, note, imgURL)
|
96
|
+
await reply(Lang.ByeSetted, "✅");
|
97
|
+
return clearMedia(filename.file);
|
98
|
+
} else {
|
99
|
+
const imgURL = 'https://i.ibb.co/pbjB2pS/93f527f9f2fb.jpg'
|
100
|
+
const note = replied_text
|
101
|
+
await setBye(amdiWA.clientJID, note, imgURL)
|
102
|
+
return await reply(Lang.ByeSetted, "✅");
|
103
|
+
}
|
104
|
+
}));
|
105
|
+
|
106
|
+
|
107
|
+
AMDI({ cmd: "getbye", desc: Lang.getbyeDesc, type: "admin", react: "📘" }, (async (amdiWA) => {
|
108
|
+
let { isGroup, reply } = amdiWA.msgLayout;
|
109
|
+
|
110
|
+
if (!isGroup) return
|
111
|
+
let byedata = await getBye(amdiWA.clientJID)
|
112
|
+
if (byedata == -1 || byedata.byenote == 'blank') return reply(Lang.nobyeset)
|
113
|
+
|
114
|
+
return await sendImage({ url: byedata.byepicurl }, {caption: '🔗 *Image URL :* \n' + byedata.byepicurl + '\n\n📄 *Bye note :* \n' + byedata.byenote, quoted: true, reactEmoji: "📖"});
|
115
|
+
}));
|
116
|
+
|
117
|
+
|
118
|
+
AMDI({ cmd: "delbye", desc: Lang.delbyeDesc, type: "admin", react: "🚮" }, (async (amdiWA) => {
|
119
|
+
let { isGroup, reply } = amdiWA.msgLayout;
|
120
|
+
|
121
|
+
if (!isGroup) return
|
122
|
+
let byedata = await getBye(amdiWA.clientJID)
|
123
|
+
if (byedata == -1 || byedata.welnote == 'blank') return reply(Lang.nobyeset)
|
124
|
+
|
125
|
+
await removeBye(amdiWA.clientJID)
|
126
|
+
return await reply(Lang.ByeDeleted, "✅");
|
127
|
+
}));
|