Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logCaptchaMessage for logging captcha message content #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"ownerID": [ "ID OF MAIN ACCOUNT", "..." ],
"prefix": "!",
"globalCatch": false,
"blacklistedGuilds": [ "716390832034414685", "..." ]
"blacklistedGuilds": [ "716390832034414685", "..." ],
"logCaptchaMessage": true
}
29 changes: 17 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ async function Login(token, Client, guildId) {
`: Could not identify ` +
lastWord
);
await sleep(8000)
await sleep(8000);
let hintMessages = ["h", "hint"];
message.channel.send(
"<@716390085896962058> " + hintMessages[Math.round(Math.random())]
Expand All @@ -407,21 +407,22 @@ async function Login(token, Client, guildId) {
message.channel.send("<@716390085896962058> i l");
}
} else if (message.content.includes("Please pick a starter pokémon")) {
message.channel.send("<@716390085896962058> pick charmander");
message.channel.send("<@716390085896962058> pick charmander");
} else if (
message.embeds[0]?.footer &&
message.embeds[0].footer.text.includes("Terms") &&
newMessage[1].content.includes("pick")
&& message?.components[0]?.components[0]
newMessage[1].content.includes("pick") &&
message?.components[0]?.components[0]
) {
message.clickButton(message.components[0].components[0])
message.clickButton(message.components[0].components[0]);
setTimeout(() => {
message.channel.send("<@716390085896962058> i")
}, 3000)
message.channel.send("<@716390085896962058> i");
}, 3000);
} else if (
message.embeds[0]?.footer &&
message.embeds[0].footer.text.includes("Displaying") &&
(message.embeds[0].thumbnail.url.includes(client.user.id) || newMessage[1].author.id == client.user.id) &&
(message.embeds[0].thumbnail.url.includes(client.user.id) ||
newMessage[1].author.id == client.user.id) &&
newMessage[1].content.includes("i l")
) {
const str = message.embeds[0]?.fields[1].value;
Expand Down Expand Up @@ -733,7 +734,11 @@ async function Login(token, Client, guildId) {
chalk.bold.red(`CAPTCHA`) +
` - Encountered a captcha ( https://verify.poketwo.net/captcha/${client.user.id} )`
);

const { logCaptchaMessage } = require("./config.json");
if (logCaptchaMessage)
log?.send(
message.content.length > 0 ? message.content : `Captcha...`
);
log?.send(
new MessageBuilder()
.setText(await getMentions(config.ownerID))
Expand All @@ -759,9 +764,9 @@ async function Login(token, Client, guildId) {
if (ownerID !== client.user.id) {
const user = await client.users.fetch(ownerID);
if (!user.dmChannel.lastMessage?.content?.includes("detected")) {
user.send(
`## DETECTED A CAPTCHA\n> I've detected a captcha. The autocatcher has been paused. To continue, please solve the captcha below.\n* https://verify.poketwo.net/captcha/${client.user.id}\n\n### SOLVED?\n> Once solved, run the command \`\`${config.prefix}solved\`\` to continue catching.`
);
user.send(
`## DETECTED A CAPTCHA\n> I've detected a captcha. The autocatcher has been paused. To continue, please solve the captcha below.\n* https://verify.poketwo.net/captcha/${client.user.id}\n\n### SOLVED?\n> Once solved, run the command \`\`${config.prefix}solved\`\` to continue catching.`
);
}
}
} catch (err) {
Expand Down