"vyhledej" tuning

This commit is contained in:
Histmy 2023-08-25 16:19:50 +02:00
parent be228e0048
commit 08fde766c4
Signed by untrusted user who does not match committer: Histmy
GPG Key ID: AC2E43C463D8F329
2 changed files with 18 additions and 4 deletions

View File

@ -93,7 +93,19 @@ const komandy: RESTPostAPIChatInputApplicationCommandsJSONBody[] = [
}
],
required: false
}
},
{
name: "ma_soubor",
description: "estli je u spravi nejakej souor",
type: ApplicationCommandOptionType.Boolean,
required: false
},
{
name: "nazev_souboru",
description: "vihledat spravi se souborem s takovim nazvem",
type: ApplicationCommandOptionType.String,
required: false
},
]
},

View File

@ -45,9 +45,11 @@ const porovnat = (filtr: CommandInteractionOption): string[] => {
const cislo = (Number(datum) - 1420070400000) * 4194304;
return [`ID ${filtr.name == "od" ? ">" : "<"} ${cislo}`];
}
case "obrasek": return [`${filtr.value ? "" : " NOT"}Attachments REGEXP "\.(png|jpe?g|gif)"`];
case "obrazekOdkaz": return [`${filtr.value ? "" : " NOT"}Content REGEXP "\.(png|jpe?g|gif)"`];
case "link": return [`${filtr.value ? "" : " NOT"}Content REGEXP "https?://"`];
case "obrasek": return [`${filtr.value ? "" : " NOT "}Attachments REGEXP "\.(png|jpe?g|gif|webp)"`];
case "obrazekOdkaz": return [`${filtr.value ? "" : " NOT "}Content REGEXP "\.(png|jpe?g|gif|webp)"`];
case "link": return [`${filtr.value ? "" : " NOT "}Content REGEXP "https?://"`];
case "ma_soubor": return [`${filtr.value ? "" : " NOT "}Attachments != "[]"`];
case "nazev_souboru": return [`Attachments LIKE ?`, `%${filtr.value}%`];
}
return [""];
};