-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
775 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* @author MạnhG | ||
* @warn Do not edit code or edit credits | ||
*/ | ||
module.exports.config = { | ||
name: "audio", | ||
version: "1.0.0", | ||
hasPermssion: 0, | ||
credits: "MạnhG", | ||
description: "Phát nhạc thông qua link YouTube hoặc từ khoá tìm kiếm nhanh", | ||
commandCategory: "Phương tiện", | ||
usages: "[Text]", | ||
cooldowns: 10, | ||
dependencies: { | ||
"ytdl-core": "", | ||
"simple-youtube-api": "", | ||
"fs-extra": "", | ||
"axios": "" | ||
}, | ||
envConfig: { | ||
"API_KEY": "mzkFree_722124509AC10" | ||
} | ||
}; | ||
var numberMoney = "500"; | ||
var rdus = Math.floor(Math.random() * 99999999999); | ||
var path = __dirname + `/cache/${rdus}.m4a`; | ||
module.exports.run = async function({ event: e, api: n, args: t, Currencies: a }) { | ||
const { threadID: s, messageID: r, senderID: o } = e, { createReadStream: i, existsSync: d, writeFileSync: l, readdirSync: h, unlinkSync: u } = global.nodemodule["fs-extra"], c = global.nodemodule.axios; | ||
var g = (await a.getData(o)).money; | ||
if (g < numberMoney) return n.sendMessage(`Bạn không đủ tiền để sử dụng lệnh này!\nBạn cần tối thiểu ${numberMoney}$ để nghe nhạc`, s, r); | ||
var { API_KEY: y } = global.configModule[this.config.name]; | ||
try { | ||
a.setData(o, options = { money: g - parseInt(numberMoney) }); | ||
let d = await c.get(`https://manhict.tech/adminkey?key=${y}`); | ||
if (1 != d.data.status) return n.sendMessage(`${d.data.msg}`, s, r); | ||
if (0 == t.length || !t) return n.sendMessage("» Search cannot be left blank!", s, r); | ||
if (0 == t.join(" ").indexOf("https://")) { | ||
const e = t.join(" ").trim(); | ||
try { | ||
var m; | ||
n.sendMessage("Đang tải, vui lòng đợi...", s, ((e, t) => setTimeout((() => { n.unsendMessage(t.messageID) }), 2e4))); | ||
let { data: t } = await c.get(`https://manhict.tech/video?link=${e}&apikey=${y}`); | ||
if ("ok" != t.status) return n.sendMessage("Erorr", s, r); | ||
m = t.title, b = t.link.audio; | ||
const a = await c.get(b, { responseType: "arraybuffer" }); | ||
return l(path, Buffer.from(a.data, "utf-8")), void n.sendMessage({ body: m, attachment: i(path) }, s, (() => u(path)), r) | ||
} catch (e) { return console.log(e), n.sendMessage("Có lỗi xảy ra!", s, r) } | ||
} else try { | ||
var p, f, b = [], | ||
M = "", | ||
v = 0; | ||
const a = encodeURIComponent(t.join(" ")); | ||
p = (await c.get(`https://manhict.tech/youtube?q=${a}&apikey=${y}`)).data.results; | ||
for (let e in p) | ||
if (null != p[e].video && (f = p[e].video).duration.length < 5 && "Live" != f.duration) { v = v += 1, b.push(f.id), M += `${v}.《${f.duration}》 ${f.title}\n\n` } | ||
var I = `»🔎 There are ${b.length} results matching your search keyword:\n\n${M}» Please reply (feedback) choose one of the above searches.`; | ||
return n.sendMessage({ body: I }, s, ((n, t) => { client.handleReply.push({ name: this.config.name, messageID: t.messageID, author: e.senderID, idYT: b }) }), r) | ||
} catch (e) { return n.sendMessage("The request could not be processed due to an error: " + e.message, s, r) } | ||
} catch (e) { return void console.log(e) } | ||
}, module.exports.handleReply = async function({ api: e, event: n, handleReply: t, Currencies: a }) { | ||
const s = global.nodemodule["ytdl-core"], | ||
{ threadID: r, senderID: o, messageID: i } = n, | ||
{ createReadStream: d, createWriteStream: l, unlinkSync: h, statSync: u } = global.nodemodule["fs-extra"]; | ||
var c = (await a.getData(o)).money; | ||
if (parseInt(o) != parseInt(t.author)) { | ||
if (c < numberMoney) return e.sendMessage(`Bạn không đủ tiền để sử dụng lệnh này!\nBạn cần tối thiểu ${numberMoney}$ để nghe nhạc`, r, i); | ||
a.setData(o, options = { money: c - parseInt(numberMoney) }) | ||
} | ||
try { | ||
s.getInfo(t.idYT[n.body - 1]).then((a => { | ||
let o = a.videoDetails.title; | ||
s(t.idYT[n.body - 1]).pipe(l(path)).on("close", (() => u(path).size > 99952214400 ? e.sendMessage("Không thể gửi file vì dung lượng lớn hơn 50MB.", r, (() => h(path)), i) : e.sendMessage({ body: `${o}`, attachment: d(path) }, r, (() => h(path)), i))).on("error", (n => e.sendMessage(`Đã xảy ra vấn đề khi đang xử lý request, lỗi: \n${n}`, r, i))) | ||
})) | ||
} catch { e.sendMessage("Không thể xử lý yêu cầu của bạn!", r, i) } | ||
return e.unsendMessage(t.messageID) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* @author MạnhG | ||
* @warn Do not edit code or edit credits | ||
*/ | ||
module.exports.config = { | ||
name: "fbvideo", | ||
version: "1.0.0", | ||
hasPermssion: 0, | ||
credits: "MạnhG", | ||
description: "Phát video/ story thông qua link Facebook", | ||
commandCategory: "Phương tiện", | ||
usages: "[link video/ story]", | ||
cooldowns: 5, | ||
dependencies: { | ||
"axios": "", | ||
"path": "", | ||
"fs-extra": "" | ||
}, | ||
envConfig: { | ||
API_KEY: "mzkFree_722124509AC10" //Nhập API_Key của bạn ở đây hoặc file config.json | ||
} | ||
}; | ||
var rdPath = Math.floor(Math.random() * 99999999999); | ||
module.exports.run = async function({ | ||
event: e, | ||
api: a, | ||
args: t | ||
}) { | ||
const { | ||
threadID: n, | ||
messageID: s | ||
} = e, r = require("axios"), i = require("fs-extra"), { | ||
API_KEY: u | ||
} = global.configModule[this.config.name]; | ||
if (!t[0]) return a.sendMessage("Bạn phải nhập url video FB !", n, s); | ||
a.sendMessage("Đang tải, vui lòng đợi...", n, ((e, t) => setTimeout((() => { | ||
a.unsendMessage(t.messageID) | ||
}), 2e4))); | ||
const c = t.join(" ").trim(); | ||
try { | ||
let { | ||
data: e | ||
} = await r.get(`https://manhict.tech/fbvideo/v2?url=${c}&apikey=${u}`); | ||
if (e.error) return a.sendMessage(e.error, n); | ||
let t = e.data.title, | ||
o = e.data.medias[1].url; | ||
var d = __dirname + `/cache/${rdPath}.mp4`; | ||
const g = (await r.get(o, { | ||
responseType: "arraybuffer" | ||
})).data; | ||
return i.writeFileSync(d, Buffer.from(g, "utf-8")), i.statSync(d).size > 104e6 ? a.sendMessage("File cannot be sent because it is larger than 100MB.", n, (() => unlinkSync(d)), s) : a.sendMessage({ | ||
body: t, | ||
attachment: i.createReadStream(d) | ||
}, n, (() => i.unlinkSync(d)), s) | ||
} catch (e) { | ||
return a.sendMessage("Không thể xử lý yêu cầu của bạn!!!", n, s) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* @author MạnhG | ||
* @warn Do not edit code or edit credits | ||
*/ | ||
module.exports.config = { | ||
name: "igdl", | ||
version: "1.0.0", | ||
hasPermssion: 0, | ||
credits: "MạnhG", | ||
description: "Tìm kiếm hình ảnh Abum Íntagram", | ||
commandCategory: "Tiện ích", | ||
usages: "[Text]", | ||
cooldowns: 0, | ||
}; | ||
module.exports.run = async function({ | ||
api: e, | ||
event: a, | ||
args: t | ||
}) { | ||
const n = require("axios"), | ||
r = require("fs-extra"), | ||
{ | ||
threadID: s, | ||
messageID: i | ||
} = (require("request"), a); | ||
if (!t[0]) return e.sendMessage("Bạn phải nhập url Igstgram !", s, i); | ||
e.sendMessage("Đang tải ảnh, vui lòng đợi...", s, ((a, t) => setTimeout((() => { | ||
e.unsendMessage(t.messageID) | ||
}), 2e4))); | ||
const g = t.join(" ").trim(), | ||
{ | ||
data: c | ||
} = await n.get(`https://manhict.tech/igdownload?link=${g}`); | ||
c.pop(); | ||
for (var u = 0, d = [], h = 0; h < c.length; h++) { | ||
let e = __dirname + `/cache/${u+=1}.jpg`, | ||
a = (await n.get(`${c[h]}`, { | ||
responseType: "arraybuffer" | ||
})).data; | ||
r.writeFileSync(e, Buffer.from(a, "utf-8")), d.push(r.createReadStream(__dirname + `/cache/${u}.jpg`)) | ||
} | ||
await e.sendMessage({ | ||
attachment: d, | ||
body: "Ảnh của bạn đây:D" | ||
}, a.threadID, a.messageID); | ||
for (let e = 1; e < c.length; e++) r.unlinkSync(__dirname + `/cache/${e}.png`) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* @author MạnhG | ||
* @warn Do not edit code or edit credits | ||
*/ | ||
module.exports.config = { | ||
name: "igdlvideo", | ||
version: "1.0.0", | ||
hasPermssion: 0, | ||
credits: "MạnhG", | ||
description: "Phát video thông qua link Instagram", | ||
commandCategory: "Phương tiện", | ||
usages: "[link Videos]", | ||
cooldowns: 5, | ||
dependencies: { | ||
"axios": "", | ||
"path": "", | ||
"fs-extra": "" | ||
}, | ||
envConfig: { | ||
API_KEY: "mzkFree_722124509AC10" //Nhập API_Key của bạn ở đây hoặc file config.json | ||
} | ||
}; | ||
var rdPath = Math.floor(Math.random() * 99999999999); | ||
module.exports.run = async function({ | ||
event: e, | ||
api: s, | ||
args: a | ||
}) { | ||
const { | ||
threadID: t, | ||
messageID: n | ||
} = e, r = require("axios"), i = require("fs-extra"), { | ||
API_KEY: o | ||
} = global.configModule[this.config.name]; | ||
if (!a[0]) return s.sendMessage("Bạn phải nhập url video IG !", t, n); | ||
s.sendMessage("Đang tải, vui lòng đợi...", t, ((e, a) => setTimeout((() => { | ||
s.unsendMessage(a.messageID) | ||
}), 2e4))); | ||
const u = a.join(" ").trim(); | ||
try { | ||
let { | ||
data: e | ||
} = await r.get(`https://manhict.tech/v1/igdl/video?url=${u}&apikey=${o}`); | ||
if (e.error) return s.sendMessage(e.error, t); | ||
let a = e.result.user.followers, | ||
c = e.result.medias[0].downloadUrl; | ||
var l = __dirname + `/cache/${rdPath}.mp4`; | ||
const d = (await r.get(c, { | ||
responseType: "arraybuffer" | ||
})).data; | ||
return i.writeFileSync(l, Buffer.from(d, "utf-8")), i.statSync(l).size > 104e6 ? s.sendMessage("File cannot be sent because it is larger than 100MB.", t, (() => unlinkSync(l)), n) : s.sendMessage({ | ||
body: `Followers: ${a}`, | ||
attachment: i.createReadStream(l) | ||
}, t, (() => i.unlinkSync(l)), n) | ||
} catch (e) { | ||
return s.sendMessage("Không thể xử lý yêu cầu của bạn!!!", t, n) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* @author MạnhG | ||
* @warn Do not edit code or edit credits | ||
*/ | ||
module.exports.config = { | ||
name: "scdl", | ||
version: "1.0.0", | ||
hasPermssion: 0, | ||
credits: "MạnhG", | ||
description: "Phát nhạc thông qua link Soundcloud", | ||
commandCategory: "Phương tiện", | ||
usages: "[link nhạc]", | ||
cooldowns: 5, | ||
dependencies: { | ||
"axios": "", | ||
"path": "", | ||
"fs-extra": "" | ||
}, | ||
envConfig: { | ||
API_KEY: "mzkFree_722124509AC10" //Nhập API_Key của bạn ở đây hoặc file config.json | ||
} | ||
}; | ||
var randomPath = Math.floor(Math.random() * 999999999999); | ||
module.exports.run = async function({ event: e, api: a, args: n }) { | ||
const { threadID: t, messageID: s } = e, i = require("axios"), { createReadStream: r, existsSync: c, writeFileSync: l, readdirSync: d, unlinkSync: o } = require("fs-extra"), { downloadFile: u } = global.utils, { API_KEY: g } = global.configModule[this.config.name]; | ||
if (!n[0]) return a.sendMessage("Bạn phải làm nhập url video FB !", t, s); | ||
a.sendMessage("Đang tải, vui lòng đợi...", t, ((e, n) => setTimeout((() => { a.unsendMessage(n.messageID) }), 2e4))); | ||
const h = n.join(" ").trim(); | ||
try { | ||
let { data: e } = await i.get(`https://manhict.tech/scdl?link=${h}&apikey=${g}`); | ||
if (e.error) return a.sendMessage(e.error, t); | ||
let n = e.title, | ||
c = e.link; | ||
var m = __dirname + `/cache/${randomPath}.mp3`; | ||
await u(c, m); | ||
return await a.sendMessage({ body: n, attachment: r(m) }, t, (() => o(m)), s) | ||
} catch (e) { return a.sendMessage("Không thể xử lý yêu cầu của bạn!!!", t, s) } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
module.exports.config = { | ||
name: "sim", | ||
version: "1.0.0", | ||
hasPermssion: 0, | ||
credits: "ManhG", | ||
description: "Chat cùng con simsimi dễ thương nhất", | ||
commandCategory: "simsimi", | ||
usages: "[args]", | ||
cooldowns: 2, | ||
dependencies: { | ||
axios: "" | ||
}, | ||
envConfig: { | ||
APIKEY: "mzkVip_Simsimi" | ||
} | ||
} | ||
async function simsimi(a, b, c) { | ||
const axios = require("axios"), | ||
{ APIKEY } = global.configModule.sim, | ||
g = (a) => encodeURIComponent(a); | ||
try { | ||
var { data: j } = await axios({ url: `http://mzkapi.me/sim?type=ask&ask=${g(a)}&apikey=${APIKEY}`, method: "GET" }); | ||
return { error: !1, data: j } | ||
} catch (p) { | ||
return { error: !0, data: {} } | ||
} | ||
} | ||
module.exports.onLoad = async function() { | ||
"undefined" == typeof global.manhG && (global.manhG = {}), "undefined" == typeof global.manhG.simsimi && (global.manhG.simsimi = new Map); | ||
}; | ||
module.exports.handleEvent = async function({ api, event }) { | ||
const { threadID, messageID, senderID, body } = event, g = (senderID) => api.sendMessage(senderID, threadID, messageID); | ||
if (global.manhG.simsimi.has(threadID)) { | ||
if (senderID == api.getCurrentUserID() || "" == body || messageID == global.manhG.simsimi.get(threadID)) return; | ||
var { data, error } = await simsimi(body, api, event); | ||
return !0 == error ? void 0 : !1 == data.answer ? g(data.error) : g(data.answer) | ||
} | ||
} | ||
module.exports.run = async function({ api, event, args }) { | ||
const { threadID, messageID } = event, body = (args) => api.sendMessage(args, threadID, messageID); | ||
if (0 == args.length) return body("Bạn chưa nhập tin nhắn"); | ||
switch (args[0]) { | ||
case "on": | ||
return global.manhG.simsimi.has(threadID) ? body("Bật gì tận 2 lần hả em.") : (global.manhG.simsimi.set(threadID, messageID), body("Bật sim thành công.")); | ||
case "off": | ||
return global.manhG.simsimi.has(threadID) ? (global.manhG.simsimi.delete(threadID), body("Tắt sim thành công.")) : body("Tao đang phấn khởi tắt cái qq."); | ||
default: | ||
var { data, error } = await simsimi(args.join(" "), api, event); | ||
return !0 == data ? void 0 : !1 == data.answer ? body(data.error) : body(data.answer); | ||
} | ||
}; |
Oops, something went wrong.