From 9278c58abf5026e7331cdafbaeeaa7ef10d0b97d Mon Sep 17 00:00:00 2001 From: amy Date: Tue, 5 Nov 2024 13:36:36 +0330 Subject: [PATCH] can we just have a stable bot --- src/main.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index e393ee2..bf7ff1e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -61,11 +61,14 @@ async function strike(message: OmitPartialGroupDMChannel>) { try { result = addOrUpdate(repliedmessage.author.id, message.author.id) } catch (e) { - message.reply('user SHOULD be already banned,,, idk lmao'); + message.reply('user should have been already banned. force redoing the ban.'); + await repliedmember.ban({reason: "ban by strike"}); + await (await client.channels.fetch(config.publiclog) as DMChannel).send("user " + repliedmember.user.globalName + "was banned due to having 3 strikes. "); return; } if (result === "duplicate") { message.reply('you have already striked this person.'); + return; } if (result === true) { await repliedmember.ban({reason: "ban by strike"}); @@ -85,11 +88,13 @@ client.on(Events.MessageCreate, async (message) => { if (message.content.startsWith("!strikecmd")){ const thing = message.content.split(" ") if (thing.length == 1){ + console.log("balls") await message.reply('WHO ARE YOU STRIKING DUMBASS'); return; } - - const id = (thing[1].match(/\d{9,10}/) || [])[0]; + console.log("balls2") + const id = (thing[1].match(/\d+/) || [])[0]; + console.log(id); const memberId = await message.guild.members.fetch(id) if (!id) { await message.reply("invalid id") @@ -99,7 +104,8 @@ client.on(Events.MessageCreate, async (message) => { try { result = addOrUpdate(id, message.author.id) } catch (e) { - message.reply('user SHOULD be already banned,,, idk lmao'); + message.reply('user should have been already banned. force redoing the ban.'); + await memberId.ban({reason: "ban by strike"}); return; } if (result === "duplicate") {