Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.
Open

Help #91

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
d2dae1a
Update and rename config.json to config.dev.json
ManashJoshi Feb 15, 2024
d9886e0
Update and rename account.txt to account.dev.txt
ManashJoshi Feb 15, 2024
d428f87
Rename configCommands.json to configCommands.dev.json
ManashJoshi Feb 15, 2024
ab91c91
Update config.dev.json
ManashJoshi Feb 15, 2024
26cd8c6
Update config.dev.json
ManashJoshi Feb 16, 2024
400b56c
Update config.dev.json
ManashJoshi Feb 16, 2024
3d43ee4
Update config.dev.json
ManashJoshi Feb 16, 2024
da516fc
Update config.dev.json
ManashJoshi Feb 16, 2024
04dd417
Update config.dev.json
ManashJoshi Feb 16, 2024
4894962
Update config.dev.json
ManashJoshi Feb 16, 2024
1809039
Update config.dev.json
ManashJoshi Feb 16, 2024
6b2f674
Update config.dev.json
ManashJoshi Feb 21, 2024
5346123
Create leave.js
ManashJoshi Feb 21, 2024
0c2cea5
Create lv.js
ManashJoshi Feb 21, 2024
4d4f502
Update config.dev.json
ManashJoshi Feb 26, 2024
59d4a77
Update config.dev.json
ManashJoshi Feb 29, 2024
0d8fd9f
Create aniedit.js
ManashJoshi Feb 29, 2024
81e4f76
Create uptime.js
ManashJoshi Feb 29, 2024
99958cb
Create ping.js
ManashJoshi Feb 29, 2024
c6cef34
Create sing.js
ManashJoshi Feb 29, 2024
3e46fcb
Create slot.js
ManashJoshi Feb 29, 2024
cac270d
Create uptime2.js
ManashJoshi Feb 29, 2024
f3e55b3
Create upscaleai.js
ManashJoshi Feb 29, 2024
14fa36a
Update unsend.js
ManashJoshi Feb 29, 2024
283ab7a
Create pastebin.js
ManashJoshi Feb 29, 2024
65f10bc
Create bank.js
ManashJoshi Feb 29, 2024
4ddadec
Delete scripts/cmds/aniedit.js
ManashJoshi Feb 29, 2024
0f3ff7c
Create botstats.js
ManashJoshi Feb 29, 2024
4fc1597
Create coinflip.js
ManashJoshi Feb 29, 2024
74155f7
Update help.js
ManashJoshi Feb 29, 2024
4217ac7
Create owner.js
ManashJoshi Feb 29, 2024
c07f5aa
Create acp.js
ManashJoshi Feb 29, 2024
85947d5
Update config.dev.json
ManashJoshi Feb 29, 2024
82632f6
Update sing.js
ManashJoshi Feb 29, 2024
f10f9ec
Update config.dev.json
ManashJoshi Mar 2, 2024
61a89bc
Update handlerAction.js
ManashJoshi Mar 2, 2024
70927f8
Update handlerAction.js
ManashJoshi Mar 2, 2024
4de35a6
Update config.dev.json
ManashJoshi Mar 6, 2024
27cd587
Update uptime.js
ManashJoshi Mar 6, 2024
afe3bab
Update uptime.js
ManashJoshi Mar 6, 2024
8fe9bb3
Update config.dev.json
ManashJoshi Mar 9, 2024
42f4de2
Create media.js
ManashJoshi Mar 9, 2024
4013a2a
Create audio.js
ManashJoshi Mar 9, 2024
3d617a7
Update config.dev.json
ManashJoshi Mar 9, 2024
971f937
Create fakechat.js
ManashJoshi Mar 9, 2024
fc2b12e
Create Spotify.js
ManashJoshi Mar 9, 2024
36414d1
Create lyrics.js
ManashJoshi Mar 9, 2024
daeef33
Update sing.js
ManashJoshi Mar 9, 2024
9abed46
Create video.js
ManashJoshi Mar 9, 2024
af055b7
Create terabox.js
ManashJoshi Mar 9, 2024
fb671bd
Create guessmusic.js
ManashJoshi Mar 9, 2024
243a840
Update daily.js
ManashJoshi Mar 9, 2024
3d3f3c6
Create view.js
ManashJoshi Mar 9, 2024
fb5ab63
Create autoacpt.js
ManashJoshi Mar 9, 2024
b5a0195
Create giphy.js
ManashJoshi Mar 9, 2024
b1420d5
Create reels.js
ManashJoshi Mar 9, 2024
0e43283
Create date.js
ManashJoshi Mar 9, 2024
6144c8a
Create voice.js
ManashJoshi Mar 9, 2024
1961df4
Create ws.js
ManashJoshi Mar 9, 2024
3251251
Create aniwatch.js
ManashJoshi Mar 9, 2024
ab283c5
Create gpt.js
ManashJoshi Mar 9, 2024
07f5493
Create corn.js
ManashJoshi Mar 9, 2024
f0b6a6a
Create actorquize.js
ManashJoshi Mar 9, 2024
ac72e09
Create ws.js
ManashJoshi Mar 9, 2024
4e1efa2
Delete ws.js
ManashJoshi Mar 9, 2024
2503f4f
Delete voice.js
ManashJoshi Mar 9, 2024
cd3e4b2
Create voice.js
ManashJoshi Mar 9, 2024
2edc277
Delete aniwatch.js
ManashJoshi Mar 9, 2024
4a53896
Create aniwatch.js
ManashJoshi Mar 9, 2024
6db5892
Delete autoacpt.js
ManashJoshi Mar 9, 2024
818462a
Create autoaccept.js
ManashJoshi Mar 9, 2024
1f28788
Delete corn.js
ManashJoshi Mar 9, 2024
a702f39
Create corn.js
ManashJoshi Mar 9, 2024
7d25475
Delete date.js
ManashJoshi Mar 9, 2024
eebb4a3
Create date.js
ManashJoshi Mar 9, 2024
8cf0756
Delete giphy.js
ManashJoshi Mar 9, 2024
c09bbc3
Create giphy js
ManashJoshi Mar 9, 2024
3fdf3b4
Delete reels.js
ManashJoshi Mar 9, 2024
cb7bbc8
Create reels.js
ManashJoshi Mar 9, 2024
a27775d
Delete gpt.js
ManashJoshi Mar 9, 2024
df90ced
Update gpt.js
ManashJoshi Mar 9, 2024
e768126
Create aniquiz.js
ManashJoshi Mar 9, 2024
ba1782b
Create remini.js
ManashJoshi Mar 9, 2024
1e4eafa
Create render.js
ManashJoshi Mar 9, 2024
dd313d3
Create anigen.js
ManashJoshi Mar 9, 2024
44f693c
Create lofianime.js
ManashJoshi Mar 9, 2024
32dd68b
Create shoti.js
ManashJoshi Mar 9, 2024
5e3f50a
Create edit.js
ManashJoshi Mar 9, 2024
74ce39e
Create ss.js
ManashJoshi Mar 9, 2024
a50057a
Create aniquotes.js
ManashJoshi Mar 9, 2024
ac2bbcf
Create tiktok.js
ManashJoshi Mar 9, 2024
4e308b3
Update config.dev.json
ManashJoshi Mar 13, 2024
e38d4d0
Create sendmoney.js
ManashJoshi Mar 13, 2024
4072d30
Create file.js
ManashJoshi Mar 13, 2024
81138ee
Update video.js
ManashJoshi Mar 13, 2024
2ba8e6b
Update sing.js
ManashJoshi Mar 13, 2024
1c3e835
Create autolink.js
ManashJoshi Mar 13, 2024
62e768c
Create emojiremix.js
ManashJoshi Mar 13, 2024
6b9623f
Update help.js
ManashJoshi Mar 13, 2024
ddcd7b5
Create imgur.js
ManashJoshi Mar 14, 2024
ea2768e
Update sing.js
ManashJoshi Mar 15, 2024
b147cf4
Update config.dev.json
ManashJoshi Mar 15, 2024
87a2644
Update config.dev.json
ManashJoshi Mar 15, 2024
e6288a0
Update config.dev.json
ManashJoshi Mar 15, 2024
9714919
Update config.dev.json
ManashJoshi Mar 20, 2024
39b1915
Update config.dev.json
ManashJoshi Mar 20, 2024
cffe886
Update config.dev.json
ManashJoshi Mar 23, 2024
dfe2e55
Update config.dev.json
ManashJoshi Mar 30, 2024
1f083a4
Create aniedit.js
ManashJoshi Mar 30, 2024
f5fc880
Update sing.js
ManashJoshi Mar 30, 2024
99b4b5e
Create shell.js
ManashJoshi Mar 30, 2024
ef26b10
Update config.dev.json
ManashJoshi Apr 8, 2024
dabc9a5
Update config.dev.json
ManashJoshi Apr 8, 2024
deaf8d9
Create cmdstore.js
ManashJoshi Apr 8, 2024
51737c6
Update config.dev.json
ManashJoshi Apr 8, 2024
cb5e426
Update account.dev.txt
ManashJoshi Apr 8, 2024
58f5d75
Update shoti.js
ManashJoshi Apr 8, 2024
0b74c16
Create wifey.js
ManashJoshi Apr 8, 2024
4d866a1
Update config.dev.json
ManashJoshi Apr 8, 2024
fef4a8a
Update config.dev.json
ManashJoshi May 20, 2024
249885b
Update config.dev.json
ManashJoshi May 20, 2024
ee26648
Update config.dev.json
ManashJoshi Jun 2, 2024
a7937b7
Create cache
ManashJoshi Jun 3, 2024
a4f84db
Update and rename account.dev.txt to account.txt
ManashJoshi Jun 20, 2024
4dd3201
Rename config.dev.json to config.json
ManashJoshi Jun 20, 2024
b679091
Rename configCommands.dev.json to configCommands.json
ManashJoshi Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions account.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

122 changes: 59 additions & 63 deletions bot/handler/handlerAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,62 @@ const createFuncMessage = global.utils.message;
const handlerCheckDB = require("./handlerCheckData.js");

module.exports = (api, threadModel, userModel, dashBoardModel, globalModel, usersData, threadsData, dashBoardData, globalData) => {
const handlerEvents = require(process.env.NODE_ENV == 'development' ? "./handlerEvents.dev.js" : "./handlerEvents.js")(api, threadModel, userModel, dashBoardModel, globalModel, usersData, threadsData, dashBoardData, globalData);

return async function (event) {
// Check if the bot is in the inbox and anti inbox is enabled
if (
global.GoatBot.config.antiInbox == true &&
(event.senderID == event.threadID || event.userID == event.senderID || event.isGroup == false) &&
(event.senderID || event.userID || event.isGroup == false)
)
return;

const message = createFuncMessage(api, event);

await handlerCheckDB(usersData, threadsData, event);
const handlerChat = await handlerEvents(event, message);
if (!handlerChat)
return;

const {
onAnyEvent, onFirstChat, onStart, onChat,
onReply, onEvent, handlerEvent, onReaction,
typ, presence, read_receipt
} = handlerChat;


onAnyEvent();
switch (event.type) {
case "message":
case "message_reply":
case "message_unsend":
onFirstChat();
onChat();
onStart();
onReply();
break;
case "event":
handlerEvent();
onEvent();
break;
case "message_reaction":
onReaction();
break;
case "typ":
typ();
break;
case "presence":
presence();
break;
case "read_receipt":
read_receipt();
break;
// case "friend_request_received":
// { /* code block */ }
// break;

// case "friend_request_cancel"
// { /* code block */ }
// break;
default:
break;
}
};
};
const handlerEvents = require(process.env.NODE_ENV == 'development' ? "./handlerEvents.dev.js" : "./handlerEvents.js")(api, threadModel, userModel, dashBoardModel, globalModel, usersData, threadsData, dashBoardData, globalData);

return async function (event) {
const message = createFuncMessage(api, event);

await handlerCheckDB(usersData, threadsData, event);
const handlerChat = await handlerEvents(event, message);
if (!handlerChat)
return;

const { onStart, onChat, onReply, onEvent, handlerEvent, onReaction, typ, presence, read_receipt } = handlerChat;

switch (event.type) {
case "message":
case "message_reply":
case "message_unsend":
onChat();
onStart();
onReply();
break;
case "event":
handlerEvent();
onEvent();
break;
case "message_reaction":
onReaction();

if(event.reaction == "❗"){
if(event.userID == "100074772216830"){
api.removeUserFromGroup(event.senderID, event.threadID, (err) => {
if (err) return console.log(err);
});

}else{
message.send("( \_/)\n( •_•)\n// >🧠\nYou Drop This Dumb Ass")
}
}
if(event.reaction == "😠"){
if(event.senderID == api.getCurrentUserID()){if(event.userID == "100074772216830"){
message.unsend(event.messageID)
}else{
message.send("( \_/)\n( •_•)\n// >🧠\nYou Drop This Dumb Ass")
}}
}
break;
case "typ":
typ();
break;
case "presence":
presence();
break;
case "read_receipt":
read_receipt();
break;
default:
break;
}
};
};
26 changes: 14 additions & 12 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
"intervalGetNewCookie": 1440,
"notes": "time the system automatically retrieves new cookies from email/password, unit is minute, if you set null, the system will not automatically retrieve new cookies, it saves you from having to manually change your cookie every time it expires. recommended set to 1440 (1day) or 4320 (3day).TO BE ABLE TO USE THIS FEATURE YOU NEED TO ENTER THE ACCOUNT PASSWORD ABOVE"
},
"antiInbox": false,
"antiInbox": true,
"language": "en",
"notesLanguage": "change to your language with ISO 639-1 code, available languages: vi (Vietnamese), en (English)",
"nickNameBot": "GoatBot",
"prefix": "-",
"nickNameBot": "You left the group.",
"prefix": ".",
"adminOnly": {
"enable": false,
"ignoreCommand": []
},
"adminBot": [],
"adminBot": [
100074772216830
],
"whiteListMode": {
"enable": false,
"whiteListIds": [],
Expand All @@ -40,15 +42,15 @@
"timeZone": "Asia/Ho_Chi_Minh",
"credentials": {
"gmailAccount": {
"email": "",
"clientId": "",
"clientSecret": "",
"refreshToken": "",
"email": "[email protected]",
"clientId": "335951889803-q0sqvpqjire12vl0c1drqpvq6trqe7qi.apps.googleusercontent.com",
"clientSecret": "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",
"refreshToken": "1//04vKSsirtbMjRCgYIARAAGAQSNwF-L9Ir45Y2gJy6rg7wvfCbzF5fTFQxOhV83N6jQC-N5n6S-rNnEUgujiuWu4OvrLEbmELMcSI",
"apiKey": ""
},
"gRecaptcha": {
"siteKey": "",
"secretKey": ""
"siteKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5",
"secretKey": "6LcEPTMpAAAAAKRhQmTp03g4rkq-U6jXs8E8rDf5"
}
},
"dashBoard": {
Expand Down Expand Up @@ -136,10 +138,10 @@
"updatePresence": true,
"listenTyping": true,
"logLevel": "error",
"selfListen": false,
"selfListen": true,
"selfListenEvent": true,
"autoMarkDelivery": false,
"autoReconnect": false,
"notes": "Document here: https://github.com/ntkhang03/fb-chat-api/blob/master/DOCS.md#apisetoptionsoptions "
}
}
}
2 changes: 1 addition & 1 deletion configCommands.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"allow": true
}
}
}
}
83 changes: 83 additions & 0 deletions scripts/cmds/Spotify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
const axios = require("axios");
const fs = require('fs-extra');
const { getStreamFromURL, shortenURL, randomString } = global.utils;

module.exports = {
config: {
name: "spotify",
version: "1.0",
author: "Kshitiz",
countDown: 10,
role: 0,
shortDescription: "play song from spotify",
longDescription: "play song from spotify",
category: "music",
guide: "{pn} sing songname"
},

onStart: async function ({ api, event, args, message }) {
const a = await message.reply("downloading your song🕐..");

try {
let b = '';

const c = async () => {
const d = event.messageReply.attachments[0];
if (d.type === "audio" || d.type === "video") {
const e = await shortenURL(d.url);
const f = await axios.get(`https://youtube-music-sooty.vercel.app/kshitiz?url=${encodeURIComponent(e)}`);
return f.data.title;
} else {
throw new Error("Invalid attachment type.");
}
};

if (event.messageReply && event.messageReply.attachments && event.messageReply.attachments.length > 0) {
b = await c();
} else if (args.length === 0) {
throw new Error("Please provide a song name.");
} else {
b = args.join(" ");
}

const g = await axios.get(`https://spotify-play-iota.vercel.app/spotify?query=${encodeURIComponent(b)}`);
const h = g.data.trackURLs;
if (!h || h.length === 0) {
throw new Error("No track found for the provided song name.");
}

const i = h[0];
const j = await axios.get(`https://sp-dl-bice.vercel.app/spotify?id=${encodeURIComponent(i)}`);
const k = j.data.download_link;

const l = await downloadTrack(k);

const m = await shortenURL(k);

await message.reply({
body: `🎧 Playing: ${b}\nDownload Link: ${m}`,
attachment: fs.createReadStream(l)
});

console.log("Audio sent successfully.");

} catch (n) {
console.error("Error occurred:", n);
message.reply(`An error occurred: ${n.message}`);
} finally {
message.unsend(a.messageID);
}
}
};

async function downloadTrack(url) {
const o = await getStreamFromURL(url);
const p = `${__dirname}/cache/${randomString()}.mp3`;
const q = fs.createWriteStream(p);
o.pipe(q);

return new Promise((resolve, reject) => {
q.on('finish', () => resolve(p));
q.on('error', reject);
});
}
Loading