diff --git a/index.ts b/index.ts index add7ef53..ecc52c71 100644 --- a/index.ts +++ b/index.ts @@ -60,12 +60,13 @@ process.on("SIGINT", async () => { main() }).on("messageCreate", async message => { if(message.author.id != global.owoID) return; - if( - !message.content.includes(message.client.user?.username!) && - !message.content.includes(message.client.user?.displayName!) && - !message.content.includes(message.guild?.members.me?.displayName!) && - !message.content.includes(message.client.user?.id!) - ) return; + if(!( + message.channel.type == "DM" || + message.content.includes(message.client.user?.id!) || + message.content.includes(message.client.user?.username!) || + message.content.includes(message.client.user?.displayName!) || + message.content.includes(message.guild?.members.me?.displayName!) + )) return; if(/are you a real human|(check|verify) that you are.{1,3}human!/img.test(message.content)) { log(`Captcha Found in Channel: #${message.channel.type == "DM" ? message.channel.recipient.displayName : message.channel.name}`) if(!global.config.autoResume && !global.config.captchaAPI) process.emit("SIGINT"); @@ -123,25 +124,26 @@ process.on("SIGINT", async () => { } } }).on("messageCreate", async (message) => { + if(!global.captchaDetected) return; if(!global.config.userNotify || message.author.id !== global.config.userNotify) return; if(message.channel.type !== "DM" || message.channel.recipient.id !== global.config.userNotify || !global.captchaDetected) return; if(/^[a-zA-Z]{3,6}$/.test(message.content)) { - let filter = (m:Message) => m.author.id === global.owoID && m.channel.type == 'DM' && /(wrong verification code!)|(verified that you are.{1,3}human!)|(have been banned)/gim.test(m.content) const msg = message + let filter = (m:Message) => m.author.id === global.owoID && m.channel.type == 'DM' && /(wrong verification code!)|(verified that you are.{1,3}human!)|(have been banned)/gim.test(m.content) try { const owo = msg.client.users.cache.get(global.owoID) if (!owo?.dmChannel) await owo?.createDM(); if(!owo || !owo.dmChannel) throw new Error("Could Not Reach OwO DM Channel"); await owo.send(msg.content) const collector = owo.dmChannel.createMessageCollector({filter, max: 1, time: 15_000}) - collector.once("collect", (m) => {msg.reply(m.content)}) + collector.once("collect", (m) => {console.log(msg.content); msg.reply(m.content)}) } catch (error) { log(`${error}`, "e") msg.reply(`${error}`) } - } else message.reply("Wrong syntax, this message will not be sent to OwO Bot!") + } else if(!(global.config.cmdPrefix && message.content.startsWith(global.config.cmdPrefix))) message.reply("Wrong syntax, this message will not be sent to OwO Bot!") }).on("messageCreate", async (message) => { - if(!global.config.cmdPrefix) return; + if(!global.config.cmdPrefix || global.config.cmdPrefix.length === 0) return; if(message.content.startsWith(global.config.cmdPrefix) && (message.author.id == global.config.userNotify || message.author.id == message.client.user?.id)) { const args = message.content.slice(global.config.cmdPrefix.length).split(/ +/) const commandName = args.shift()?.toLowerCase() diff --git a/package.json b/package.json index 5054a7cb..5c1c9514 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-owo-selfbot", - "version": "2.2.4", + "version": "2.2.5", "description": "Ain't the best OwO Tool Farm, but worth a try (why not?)", "type": "module", "exports": "./dist/index.js", diff --git a/src/DataCollector.ts b/src/DataCollector.ts index 946f9494..92615560 100644 --- a/src/DataCollector.ts +++ b/src/DataCollector.ts @@ -275,7 +275,6 @@ const huntBot = (cache?:number) => { type: "list", message: "Select which huntbot trait to upgrade, empty to skip", choices: [ - {name: "Skip", value: NaN}, {name: "Efficiency", value: 1}, {name: "Duration", value: 2}, {name: "Cost", value: 3}, @@ -375,7 +374,7 @@ export const collectData = async (data:{[key:string]: Configuration}) => { if(solveCaptcha != 0) autohunt = await getResult(trueFalse("Toggle Automatically send/receive AutoHunt/Huntbot", cache?.autoHunt)) if(autohunt) upgradetrait = await getResult(huntBot(cache?.upgradeTrait)) autogamble = await getResult(Gamble(cache?.autoGamble)) - gamblingAmount = await getResult(gambleAmount(cache?.gamblingAmount)) + if(autogamble.length > 0) gamblingAmount = await getResult(gambleAmount(cache?.gamblingAmount)) autoquote = await getResult(trueFalse("Toggle Automatically send owo/quotes to level up", cache?.autoQuote)) autoslash = await getResult(trueFalse("Toggle Automatically use slash commands", cache?.autoSlash)) autoother = await getResult(trueFalse("Toggle Automatically send Run/Pup/Piku commands", cache?.autoOther)) diff --git a/src/Extension.ts b/src/Extension.ts index 96d248eb..77d2c1fe 100644 --- a/src/Extension.ts +++ b/src/Extension.ts @@ -139,7 +139,7 @@ const commandHandler = async () => { } const suffix = ".js" - const commandFiles = getFiles(path.join(process.cwd(), "/src/commands/"), suffix) + const commandFiles = getFiles(path.join(process.cwd(), "/dist/src/commands/"), suffix) for(const command of commandFiles) { let commandFile = await import(`file://${command}`)