Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- [x] check harmful messages
- [x] check spam across different groups (mute + del)
- [ ] exception to send our whatsapp links?
- [ ] do not delete Direttivo's allowed messages
- [x] do not delete Direttivo's allowed messages (/grant command)
- [x] check if user has username
- [ ] group-specific moderation (eg. #cerco #vendo in polihouse) see [here](https://github.com/PoliNetworkOrg/PoliNetworkBot_CSharp/blob/03c7434f06323ffdec301cb105d1d3b2c1ed4a95/PoliNetworkBot_CSharp/Code/Bots/Moderation/Blacklist/Blacklist.cs#L84)
- [x] role management
Expand Down
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false },
"formatter": {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"test": "vitest",
"typecheck": "tsc --noEmit",
"check": "biome check",
"check:fix": "biome check --write"
"check:fix": "biome check --write --unsafe"
Comment thread
toto04 marked this conversation as resolved.
Comment thread
lorenzocorallo marked this conversation as resolved.
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@biomejs/biome": "2.2.4",
"@biomejs/biome": "2.3.11",
"@trpc/server": "11.5.1",
"@types/node": "^22.13.1",
"globals": "^15.14.0",
Expand All @@ -37,7 +37,7 @@
"@grammyjs/menu": "^1.3.1",
"@grammyjs/parse-mode": "^1.11.1",
"@grammyjs/runner": "^2.0.3",
"@polinetwork/backend": "^0.12.0",
"@polinetwork/backend": "^0.13.1",
"@t3-oss/env-core": "^0.13.4",
"@trpc/client": "^11.5.1",
"@types/ssdeep.js": "^0.0.2",
Expand Down
84 changes: 42 additions & 42 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions src/commands/banall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ import z from "zod"
import { api } from "@/backend"
import { modules } from "@/modules"
import { getTelegramId } from "@/utils/telegram-id"
import type { Role } from "@/utils/types"
import { numberOrString, type Role } from "@/utils/types"
import { _commandsBase } from "./_base"

const numberOrString = z.string().transform((s) => {
const n = Number(s)
if (!Number.isNaN(n) && s.trim() !== "") return n
return s
})

const BYPASS_ROLES: Role[] = ["president", "owner", "direttivo"]

_commandsBase
Expand All @@ -26,7 +20,7 @@ _commandsBase
{
key: "username",
type: numberOrString,
description: "The username or the user id of the user you want to update the role",
description: "The username or the user id of the user you want to ban from all groups",
},
{
key: "reason",
Expand Down
Loading