From 7073ae434a720492c4e12a375f3cdbe55fa4052f Mon Sep 17 00:00:00 2001 From: Zoe Lembrik Date: Thu, 9 Jul 2026 15:27:54 +0400 Subject: [PATCH 1/3] feat: added nyaa purr awawawawawawawaw --- src/telegram/bot/download.ts | 21 ++++++++++++++++++--- src/telegram/helpers/meow.ts | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 src/telegram/helpers/meow.ts diff --git a/src/telegram/bot/download.ts b/src/telegram/bot/download.ts index 59b4698..ad68355 100644 --- a/src/telegram/bot/download.ts +++ b/src/telegram/bot/download.ts @@ -20,15 +20,30 @@ import { import { deferredReply, replyText } from "@/telegram/helpers/sent" import { getPeerSettings } from "@/telegram/helpers/settings" import { evaluatorsFor } from "@/telegram/helpers/text" +import { mrowCheck } from "../helpers/meow" export const downloadDp = Dispatcher.child() const errorDeleteDelay = 30 * 1000 downloadDp.onNewMessage(async (msg) => { - if (/^(?:\s?m+(?:i+a+(?:u+|o*w+)|r{2,}|r+(?:e?o+w+|p+)|e+a*o*w+))+(?:\s*:[3з])*$/.test(msg.text.toLowerCase().trim())) { - await msg.replyText("meow :з") - return + switch (mrowCheck(msg.text)) { + case "meow": { + await msg.replyText("meow :з") + return + } + case "nya": { + await msg.replyText("pat-pat :з") + return + } + case "purr": { + await msg.replyText("meaaaauuuu (miau)") + return + } + case "awawawa": { + await msg.replyText("awawawawawawawwwawawawawawawawawaw") + return + } } const isGroupChat = msg.chat.type === "chat" diff --git a/src/telegram/helpers/meow.ts b/src/telegram/helpers/meow.ts new file mode 100644 index 0000000..6d321cf --- /dev/null +++ b/src/telegram/helpers/meow.ts @@ -0,0 +1,14 @@ +export function mrowCheck(text: string): "meow" | "nya" | "purr" | "awawawa" | undefined { + const msgPrepped = text.toLowerCase().trim() + const meowRegex = /^(?:\s?m+(?:i+a+(?:u+|o*w+)|r{2,}|r+(?:[ae]?o+w+|p+)|e+a*o*w+))+(?:\s*:[3з])*$/ + const nyaRegex = /^(?:\s?n+y+a+)+(?:\s*:[3з])*$/ + const purrRegex = /^(?:\s?p+u+r+)+(?:\s*:[3з])*$/ + const awawawwwRegex = /^aw[aw]{3,}(?:\s*:[3з])*$/ + + switch (true) { + case meowRegex.test(msgPrepped): return "meow" + case nyaRegex.test(msgPrepped): return "nya" + case purrRegex.test(msgPrepped): return "purr" + case awawawwwRegex.test(msgPrepped): return "awawawa" + } +} From 1edb0e84665b8092056560318262491db10639f6 Mon Sep 17 00:00:00 2001 From: Zoe Lembrik Date: Thu, 9 Jul 2026 15:53:26 +0400 Subject: [PATCH 2/3] fix: change meow import to @/ --- src/telegram/bot/download.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/telegram/bot/download.ts b/src/telegram/bot/download.ts index ad68355..9111ee6 100644 --- a/src/telegram/bot/download.ts +++ b/src/telegram/bot/download.ts @@ -17,10 +17,10 @@ import { handleMediaDownload, OutputButton, } from "@/telegram/helpers/handler" +import { mrowCheck } from "@/telegram/helpers/meow" import { deferredReply, replyText } from "@/telegram/helpers/sent" import { getPeerSettings } from "@/telegram/helpers/settings" import { evaluatorsFor } from "@/telegram/helpers/text" -import { mrowCheck } from "../helpers/meow" export const downloadDp = Dispatcher.child() From 2748600d9765b3744132b8a8e512473bae89e856 Mon Sep 17 00:00:00 2001 From: Zoe Lembrik Date: Thu, 9 Jul 2026 16:16:40 +0400 Subject: [PATCH 3/3] fix: address mimr changes --- src/telegram/bot/download.ts | 21 ++++----------------- src/telegram/helpers/meow.ts | 32 ++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/telegram/bot/download.ts b/src/telegram/bot/download.ts index 9111ee6..4165b3d 100644 --- a/src/telegram/bot/download.ts +++ b/src/telegram/bot/download.ts @@ -27,23 +27,10 @@ export const downloadDp = Dispatcher.child() const errorDeleteDelay = 30 * 1000 downloadDp.onNewMessage(async (msg) => { - switch (mrowCheck(msg.text)) { - case "meow": { - await msg.replyText("meow :з") - return - } - case "nya": { - await msg.replyText("pat-pat :з") - return - } - case "purr": { - await msg.replyText("meaaaauuuu (miau)") - return - } - case "awawawa": { - await msg.replyText("awawawawawawawwwawawawawawawawawaw") - return - } + const meowReply = mrowCheck(msg.text) + if (meowReply) { + await msg.replyText(meowReply) + return } const isGroupChat = msg.chat.type === "chat" diff --git a/src/telegram/helpers/meow.ts b/src/telegram/helpers/meow.ts index 6d321cf..a5b11a3 100644 --- a/src/telegram/helpers/meow.ts +++ b/src/telegram/helpers/meow.ts @@ -1,14 +1,26 @@ -export function mrowCheck(text: string): "meow" | "nya" | "purr" | "awawawa" | undefined { +const MEOW_REGEX = /^(?:\s?m+(?:i+a+(?:u+|o*w+)|r{2,}|r+(?:[ae]?o+w+|p+)|e+a*o*w+))+(?:\s*:[3з])*$/ +const NYA_REGEX = /^(?:\s?n+y+a+)+(?:\s*:[3з])*$/ +const PURR_REGEX = /^(?:\s?p+u+r+)+(?:\s*:[3з])*$/ +const AWAWAWAW_REGEX = /^aw[aw]{3,}(?:\s*:[3з])*$/ + +export function mrowCheck(text: string): string | null { const msgPrepped = text.toLowerCase().trim() - const meowRegex = /^(?:\s?m+(?:i+a+(?:u+|o*w+)|r{2,}|r+(?:[ae]?o+w+|p+)|e+a*o*w+))+(?:\s*:[3з])*$/ - const nyaRegex = /^(?:\s?n+y+a+)+(?:\s*:[3з])*$/ - const purrRegex = /^(?:\s?p+u+r+)+(?:\s*:[3з])*$/ - const awawawwwRegex = /^aw[aw]{3,}(?:\s*:[3з])*$/ - switch (true) { - case meowRegex.test(msgPrepped): return "meow" - case nyaRegex.test(msgPrepped): return "nya" - case purrRegex.test(msgPrepped): return "purr" - case awawawwwRegex.test(msgPrepped): return "awawawa" + if (MEOW_REGEX.test(msgPrepped)) { + return "meow :з" + } + + if (NYA_REGEX.test(msgPrepped)) { + return "pat-pat :з" + } + + if (PURR_REGEX.test(msgPrepped)) { + return "meaaaauuuu (miau)" + } + + if (AWAWAWAW_REGEX.test(msgPrepped)) { + return "awawawawawawawwwawawawawawawawawaw" } + + return null }