Skip to content

Commit 0d9e000

Browse files
WIPocketUbuntu
authored andcommitted
růst
1 parent 0d9e000 commit 0d9e000

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tgbot.deno.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ Be grateful for your abilities and your incredible success and your considerable
514514
},
515515
{
516516
"trigger": "Rust",
517+
"regex": /R[uů]st/i,
517518
"genitiv": "Rustu",
518519
"popis": "Rust je jenom glorified C++ a měl by být zakázán",
519520
},
@@ -524,12 +525,16 @@ Be grateful for your abilities and your incredible success and your considerable
524525
},
525526
];
526527

527-
for (const { trigger, genitiv, popis } of bannedWords) {
528+
for (const { trigger, genitiv, popis, regex } of bannedWords) {
528529
const disclaimer =
529530
`Upozornění: Tato zpráva obsahuje ${trigger}. Jsem si vědom tohoto prohřešku, ${popis} a tato zpáva nesmí být interpretována jako podpora ${genitiv}.`;
530531
if (text.includes(disclaimer)) continue;
531532

532-
if (text.toLowerCase().includes(trigger.toLowerCase())) {
533+
if (
534+
regex
535+
? text.match(regex)
536+
: text.toLowerCase().includes(trigger.toLowerCase())
537+
) {
533538
await tgCall(
534539
{
535540
chat_id: data.message.chat.id,

0 commit comments

Comments
 (0)