-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added sweeper (reduce memory), fixed time pause too long, added commands
- Loading branch information
1 parent
28dc70d
commit a8c9c38
Showing
32 changed files
with
377 additions
and
21 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
const helpCommand = { | ||
name: "help", | ||
description: "List of Tool Commands", | ||
execute: (agent, message, ...args) => { | ||
let document = ""; | ||
const listCommand = Object.keys(agent.commands); | ||
for (const command of listCommand) | ||
document += `**${command}:** ${agent.commands.get(command)?.description}\n`; | ||
document += "Join Our Support Server For Help: https://discord.gg/Yr92g5Zx3e"; | ||
if (args[0]) | ||
message.reply(listCommand.includes(args[0]) | ||
? `**${args[0]}:** ${agent.commands.get(args[0])?.description}` | ||
: "Command Not Found!"); | ||
else | ||
message.reply(document); | ||
} | ||
}; | ||
export {}; |
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,10 @@ | ||
import { timeHandler } from "../utils/utils.js"; | ||
const infoCommand = { | ||
name: "info", | ||
description: "Tool Information", | ||
execute: (agent, message, ...args) => { | ||
const status = agent.captchaDetected ? agent.paused ? "**PAUSED**" : "**PENDING CAPTCHA**" : "HUNTING"; | ||
message.reply(`__Uptime:__ **${timeHandler(agent.readyTimestamp ?? 0, Date.now())}**\n__Status:__ ${status}`); | ||
} | ||
}; | ||
export default infoCommand; |
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,17 @@ | ||
const pauseCommand = { | ||
name: "pause", | ||
description: "Pause the Tool", | ||
execute: (agent, message, ...args) => { | ||
if (agent.captchaDetected) { | ||
message.reply(agent.paused | ||
? "Tool is already paused!" | ||
: "**ACTION REQUIRED!** You must solve the captcha before pausing the tool"); | ||
} | ||
else { | ||
agent.captchaDetected = true; | ||
agent.paused = true; | ||
message.reply("Tool is paused!"); | ||
} | ||
} | ||
}; | ||
export default pauseCommand; |
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,8 @@ | ||
const pingCommand = { | ||
name: "ping", | ||
description: "Tool Website Service Ping", | ||
execute: (agent, message, args) => { | ||
message.reply(`Pong! ${message.client.ws.ping}ms~`); | ||
} | ||
}; | ||
export default pingCommand; |
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,12 @@ | ||
const reloadCommand = { | ||
name: "reload", | ||
description: "Reload The Configuration", | ||
execute: async (agent, message, ...args) => { | ||
const attempt = await agent.aReload(true); | ||
if (attempt) | ||
message.reply("The configuration has been refreshed successfully"); | ||
else | ||
message.reply("Failed to refresh the configuration"); | ||
} | ||
}; | ||
export default reloadCommand; |
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,17 @@ | ||
const resumeCommand = { | ||
name: "resume", | ||
description: "Resume the Tool", | ||
execute: (agent, message, ...args) => { | ||
if (agent.paused) { | ||
agent.paused = false; | ||
agent.captchaDetected = false; | ||
message.reply("Tool is resume!"); | ||
agent.main(); | ||
} | ||
else | ||
message.reply(agent.captchaDetected | ||
? "**ACTION REQUIRED!** You must solve the captcha before resuming the tool" | ||
: "Tool is not paused!"); | ||
} | ||
}; | ||
export default resumeCommand; |
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,8 @@ | ||
const sayCommand = { | ||
name: "say", | ||
description: "Make the Tool Perform command/say something", | ||
execute: (agent, message, ...args) => { | ||
message.channel.send(args.join(" ")); | ||
} | ||
}; | ||
export default sayCommand; |
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,30 @@ | ||
const sendCommand = { | ||
name: "send", | ||
description: "Send cash to someone", | ||
execute: (agent, message, ...args) => { | ||
try { | ||
if (message.channel.type == "DM" || message.channel.type == "GROUP_DM") | ||
return message.reply("You must send this command in a server"); | ||
if (!args || args.length < 2) | ||
return message.reply("You must mention someone and amount of cowoncy"); | ||
const target = message.mentions.members?.first(); | ||
const owo = message.guild?.members.cache.get(agent.owoID); | ||
if (!target) | ||
return message.reply("You must mention an user to send cowoncy"); | ||
if (!owo) | ||
return message.reply("OwO bot not found!"); | ||
if (!args[1]?.match(/^[0-9]+$/)) | ||
return message.reply("You must include an amount of cowoncy to send"); | ||
message.channel.send(`owo send <@!${target.id}> ${args[1]}`); | ||
message.channel.createMessageCollector({ | ||
filter: (msg) => msg.author.id == agent.owoID && msg.embeds.length > 0 && msg.embeds[0].author?.name.includes(msg.guild?.members.me?.displayName) && msg.embeds[0].author?.name.includes(target.displayName) && msg.components.length > 0, | ||
max: 1, time: 10_000 | ||
}).once("collect", async (m) => { await m.clickButton({ X: 0, Y: 0 }); }); | ||
} | ||
catch (error) { | ||
message.reply("Failed to Perform command"); | ||
console.error(error); | ||
} | ||
} | ||
}; | ||
export default sendCommand; |
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,18 @@ | ||
import decryptCaptcha from "../security/decrypt.js"; | ||
const solveCommand = { | ||
name: "solve", | ||
description: "Retry solving HCaptcha", | ||
execute: async (agent, message, ...args) => { | ||
if (!agent.captchaDetected) | ||
return message.reply("No captcha detected"); | ||
try { | ||
await decryptCaptcha(message, agent.config); | ||
message.reply("✅ Captcha solved!"); | ||
} | ||
catch (error) { | ||
console.error(error); | ||
message.reply("❌ Attempt to solve captcha failed."); | ||
} | ||
} | ||
}; | ||
export default solveCommand; |
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,13 @@ | ||
import { consoleNotify } from "../feats/notify.js"; | ||
import { logger } from "../utils/logger.js"; | ||
const stopCommand = { | ||
name: "stop", | ||
description: "Stop the Tool from Running", | ||
execute: (agent, message, ...args) => { | ||
message.reply("Shutting down..."); | ||
logger.info("User executed STOP command, shutting down..."); | ||
consoleNotify(agent.totalCommands, agent.totalTexts, agent.readyTimestamp ?? 0); | ||
process.emit("SIGINT"); | ||
} | ||
}; | ||
export default stopCommand; |
Binary file not shown.
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,12 @@ | ||
export const loadSweeper = async (agent) => { | ||
return agent.options.sweepers = { | ||
messages: { | ||
interval: 3_600, | ||
lifetime: 1_800, | ||
}, | ||
users: { | ||
interval: 3_600, | ||
filter: () => user => [...agent.RETAINED_USERS_IDS, user.client.user?.id].includes(user.id), | ||
} | ||
}; | ||
}; |
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
Oops, something went wrong.