Repository navigation
Immutable
release. Only release title and notes can be modified.
Added
/purchase(and!purchase): where to buy Premium for a server, a plan for yourself or a pack of ceramos. Why: the maintainer wanted a command that gives the purchase links. What: a Components V2 card with three link buttons (Premium for a server, Plans for you, Ceramos) that open the pages of the website, where the person signs in with Discord, accepts the terms and goes on to the payment; the bot does not create the checkout itself, so the terms window is never skipped. Written in TypeScript (commands/utility/purchase.ts), in English, Spanish and Portuguese, registered in each server (second set).- Custom commands: choose where each one works. Why: the maintainer wanted a custom command to be limited to some channels or roles, like the commands of other bots. What: a custom command keeps lists of allowed and blocked channels and roles (blocked wins), an NSFW switch (it answers only in an age-restricted channel) and a Restricted switch (a member who is not a moderator is answered in another channel); a command that is not allowed stays silent. The old lists of the commands written in code are read as the same lists (
utils/commandScope.js). - A badge can show any frame it has. Why: the maintainer wanted to choose between the normal, the golden and the divine frame of each badge. What:
user_badges.shown_framesaves the choice (only among the frames the person has unlocked),/profileand the shop draw it, and the best frame is never lost. - A second instance of the bot (Docker, a VPS, shards), with the dashboard, the jobs and the other databases. Why: the maintainer wanted to run Petto in another place for shards, while Discloud keeps the databases and does not accept outside connections, and asked that the dashboard reach those servers, that the jobs work for them, that the Vault and the other databases and Redis not be a limit, and that the trips to the database cost less. What:
Dockerfile,.dockerignore,docker-compose.worker.ymlanddocs/SECOND_INSTANCE.md.PETTO_ROLE=workermakes an instance a worker (utils/instanceRole.ts): its own shards (DISCORD_SHARDS,DISCORD_SHARD_COUNT), no public web, no slash command registration, no schema, and the jobs for its own servers except the ones that work on the whole bot (PETTO_WORKER_JOBS:guildby default,essential,all). SQL bridge (db/sqlBridge.ts): the primary servesPOST /api/bridge/dbwhenPETTO_BRIDGE_SECRET(32 characters or more) is set; signed with HMAC-SHA256, old or repeated requests refused, 2 MB, 24 at once, 8 transactions of 30 s; a lost answer asked again does not run twice; dates, bytes and database error codes travel intact. It reaches the main database, the Vault, the code database and the second one (db/bridgeTargets.js: the worker asks which exist, so it needs no database URL); queries of the same moment share one trip (PETTO_BRIDGE_BATCH_MS) and plain SELECTs are remembered forPETTO_BRIDGE_CACHE_MS(3 s, forgotten after any write or dashboard message). Link (utils/instanceLink.ts,utils/linkRuntime.ts): the worker keeps a WebSocket open to the primary (it goes out from the worker, no open port needed); every route with a:guildIdof the primary looks at the shard of the server and sends the request through the link when a connected worker holds it (503 shard_unavailablewhen nobody does), and the worker answers with its own copy of the routes on127.0.0.1; the Redis messagespetto:*travel both ways, so the worker needs no Redis. Jobs of a split instance only see their own servers: the query builder adds the shard condition to a job's read of a table withguild_id, a raw SELECT drops other shards' rows, andclaimDueof the code schedule names the shards (db/postgres.js; the global jobs see everything).!perfshows the trips, their time, shared trips, answers from memory, the link and the workers.PETTO_READ_DATABASE_URLis a hook for a read-only copy used by the statistics. New dependencyws. Checked inscripts/check-sql-bridge.jsandscripts/check-instance-link.js(a real WebSocket on localhost); the image was not built (no Docker daemon in the sandbox), and nothing was tried against the real Discloud databases, a real VPS or real shards. Not covered: public pages that find the server by a token, jobs that find their servers without aguild_idin the rows, and servers whose shard nobody holds. - Quarantine and fallbacks: a part that keeps failing rests, and a rate limit is waited for once. Why: the maintainer asked that, if the bot fails, that part is put apart so it does not break the rest of the code, with a fallback for rate limits. What:
utils/quarantine.ts(typed, plain functions) puts apart an event listener, an interval job or a call to an outside service that failed at least 8 times in a minute and in at least half of its runs; it rests 1 minute (twice as long after every failed trial, up to 15 minutes) and then ONE trial run decides if it comes back (half open). The commands, moderation, tickets, verification and the jobs that must always run are never put apart (the lists ofloadGuard). The team is told once when a part rests (logger.error) and once, only in the console, when it is back.handlers/eventHandler.jsandutils/perf.js(trackIntervals) use it for every listener and job at once;!perf quarantinelists what rests and the summary shows it.utils/fallback.ts:withFallbackwaits what a rate limit (429) asks (never more than 5 s) and tries once more, then gives the fallback; a rate limit is not counted as a failure of the part; a part that rests answers the fallback at once without being called. The detector of pictures uses it (a 429 is waited for, an outage rests, and every case ends as "not checked"). Checked inscripts/check-quarantine.js(clock moved by hand, listeners, a real interval job and the detector with a fake service). - Streaks: choose what counts as a message. Why: the maintainer asked for the rest of the streak settings (minimum length, cooldown, filters by channel or role, and reactions as messages). What: in Streaks > Activity a server can set a minimum number of characters, one counted message every so many seconds for each person, only (or everywhere but) some channels or roles (a thread or channel also counts through its category), and a reaction that counts as a message (the length is not asked of a reaction). All of it is off by default and the streaks keep reading
activity_members. When a rule is turned on the server gets a start day (counting_since): from that day the messages come from the new tablestreak_days(a number for each person and day, never what was said; kept 13 months, deleted with the server or when a person asks not to be counted) and the days before keep what they had; the voice time always comes fromactivity_members. New columns instreak_config(min_length,cooldown_seconds,channel_mode,channel_ids,role_mode,role_ids,reactions_count,counting_since); new eventsmessageCreateStreakCountandmessageReactionAddStreakCount; the rules are kept a minute in memory, so a change takes up to a minute to be noticed. Checked against a real PostgreSQL 16 (the wholeschema.sqlapplies, and the days a streak reads, the batches and the deletes were tried there); not against real Discord. Checks inscripts/check-streak-counting.js(the database part runs withPETTO_TEST_DATABASE_URL). - Limits bonus of the plans: more reminders waiting at once. Why: the plans promised +25 %, +50 % and +100 % on their limits. What: the 25 reminders a person can have waiting become 31 with Bronze, 37 with Silver and 50 with Gold (the answer when the limit is reached tells the real number); a plan that ended or cannot be read gives 25. Embeds and replies are limits of the server, not of a person, so they do not change with a personal plan; the Plans pages now say "reminders" instead of "embeds, replies, reminders". Checks in
scripts/check-limits-bonus.js. - Own badges with a plan (Bronze 1, Silver 2, Gold 4). Why: the maintainer asked for the own badges of the plans. What: a person makes a badge with a name (2 to 24 letters or numbers) and a picture (PNG, JPEG or WebP, cut to a square of 256 x 256; a GIF is not accepted); it goes through the same policy, block and detector as the own pictures and waits for the team in the page "Own pictures" of the staff; when it is approved it becomes a badge of the editor with the id
own-<person>-<slot>that is off sale, so only its maker has it and can put it in the showcase; a new one for the same slot waits while the approved one stays; the person can remove theirs, and the team can take one down (with a block if it says so). If the plan ends, what they have stays but nothing new can be made. New tableuser_own_badges; new routesown-badge-state,own-badge-submit,own-badge-remove,admin/own-badges,admin/own-badge-reviewandadmin/own-badge-file; the badges of this kind are left out of the editor of the team. The waiting animated pictures are now served as PNG (not WebP) to the staff page. Not verified: no real Discord, database or OpenAI. Checks inscripts/check-own-badges.js. - Own picture for the rank card: an animated one with the Gold plan, a detector for every picture, and a contact email. Why: the maintainer asked for the animated background of the Gold plan, the image detector and the contact email of the Terms. What: with Gold a GIF is the background of the rank card and it moves (each frame is cut to the banner and kept as an APNG of at most 3 MB and 30 frames; the card goes out as an APNG and, if it would be too big for a message, loses half of its frames until it fits or goes out still); with Silver a GIF is only its first picture; when the plan ends the card shows the first picture. Every own picture goes through the OpenAI moderation endpoint (
omni-moderation-latest, new envOPENAI_API_KEY;PETTO_IMAGE_SCREEN=falseturns it off) before the team sees it: a picture with sexual, violent or hateful content is not accepted and the person is told; one with minors is never kept and blocks the person (the team can undo it); if the service is off or fails the picture waits for the team marked as not checked. New tableuser_contactand columnuser_uploads.screened. Not verified: no real OpenAI answer, no real Discord and no real database; the GIF reader was only tried with a GIF made by ffmpeg and with hand-made ones. Checks inscripts/check-uploads.jsandscripts/check-cards.js. - The six Bufis have their own pictures. Why: the maintainer asked for the mascots of the Bufis. What: the six Bufis the maintainer drew (gray, pink, green and yellow, yellow and black, yellow and blue), in
src/assets/badges/bufi-*.png; they show in the shop, the showcase and the profile card instead of the plain hexagon. - Streaks: grace period, reminder and lost-streak DMs, and the streak in the nickname. Why: the maintainer asked for the rest of the streak settings. What: a server can give up to 3 hours after midnight (UTC) in which the day that ended still counts; DM a reminder (in the last 3 hours of the day) to who would lose a streak of 3 days or more, and a message to who lost one; and write the streak in the nickname (
name | 7 🔥, from 2 days; a custom emoji needs Premium, else the fire)./streak notifications:falseturns the DMs and the nickname off for a member (streak_optout). A reminder or a lost-streak message goes once a day (streak_notices), only the members active in the last three days are looked at, and Petto only changes a nickname it can manage. - A pack of ceramos that the payment service refunded takes its ceramos back. Why: the refunds were not handled (the maintainer asked for it). What: the route
credit-refundtakes back the ceramos of an order once (the order is marked in the same statement, so the event arriving twice takes them once). What the person already spent cannot be taken: only what is left, never more than the pack gave, and the ledger says the amount really taken (refund). The person comes from the saved order, never from the event. - Backups are a Premium feature and live only in the Vault. Why: the maintainer wanted backups to be paid by server, kept in their own database and never in the main one. What: making a backup (
!backup, the menu, the dashboard) and scheduling them needs Premium on the server; a server without Premium can still list, export, restore and delete the backups it has, and its schedule is kept but not run (it runs again with Premium). The fallback that saved backups in the main database is gone: withoutPETTO_VAULT_DATABASE_URLthere are no backups and the commands say so. Once the Vault is connected, the old backups of the main database (guild_backups,guild_backup_audit) are deleted for good, one minute after start. The old Vault database, if it was a different one, is not touched. - Streaks go further: modes, milestones, reward roles, freezes for the server and a board. Why: the maintainer wanted the streaks page of the dashboard to have Activity, Rewards, Safety net and Leaderboard. What: a server chooses what earns the day (messages, voice, either, or both on the same day); a channel where Petto announces a milestone (3, 7, 14, 30, 60, 100 and 365 days by default, editable); roles given at a number of days; freezes the server gives to everyone (they add to the ones of the plan); and a board of the best streaks (current or longest) with a reset that starts every streak again. A job (
jobs/streakJob.ts, every 10 minutes) looks only at the members active today or yesterday, gives each role and says each milestone once (streak_awards), and a streak that was already long when it was turned on is not announced. Not built yet: grace period, reminder and lost-streak DMs, nickname with the streak, message length, cooldown, filters and reactions as messages. - Streaks: days in a row with activity in a server, with freezes from the plan. Why: the maintainer asked for streaks per server and for the freezes of the plans. What: each server decides what an active day is (
streak_config: a minimum of messages and of minutes in voice; streaks can be turned off); the streak is worked out fromactivity_members, so nothing is stored for it. A freeze (1 with Bronze, 3 with Silver, 5 with Gold, for each streak) covers a missed day inside a streak; a streak is alive while today or yesterday is covered. New command/streak(the streak, the best one, freezes used, whether today counts) and routeGET streaks(every server where the person has been active). Written in TypeScript;scripts/check-streaks.jschecks the active days, the current and best streak, the freezes, the plan and the server settings. Not verified: not run in Discord or against a real database. Not done: roles and announcements at milestones, the streak in the nickname, a leaderboard of streaks. - The Bufis: six badges of the shop (Normal, Silver, Girl, Boy, Bu and Black Friday). Why: the maintainer showed the profile with the Bufis and asked to add them without the mascots. What: they are in the Special tab, each is drawn as a plain hexagon of its color until the team gives it a picture in the editor of badges; Black Friday is on sale only from 2026-11-20 to 2026-12-02 and whoever buys it keeps it.
scripts/check-bufis.jschecks them. Not verified: not run in Discord or against a real database. - Own picture: a background of the rank card made by the person, with a plan, a policy and a review. Why: the maintainer asked for the lock by plan, the user policy and the review of what people upload. What: with a plan that allows it (Silver or Gold,
ownBackgroundinutils/userPlans.ts; animated ones are drawn still) a person accepts the user policy (user_policy, version 1) and sends a picture (1 MB at most, PNG, JPEG or WebP, at least 800 x 200, cut to 1024 x 320 WebP). It waits inuser_uploadsand nobody sees it until the owner approves it; a new one waits while the approved one stays. The owner approves, rejects (with a reason), takes down what a person has (a copyright claim, a report), blocks (upload_blocks) and unblocks; a picture with a minor is removed and blocks the person at once (reporting it as the law asks is up to the team: nothing sends it anywhere). The approved picture is a rank card background (upload:own). New routesupload-state,upload-policy,upload-submitandadmin/uploads,admin/upload-review,admin/upload-file. Written in TypeScript;scripts/check-uploads.jschecks the plan, the policy, the file, the review, the claims, the minor and the block. Not verified: not run against a real database or the real website; nothing detects a picture by itself (the review is by people); the email of contact that the Terms mention is not saved because the login does not ask for it. - Missions: messages and minutes in voice, every day and every week, pay ceramos. Why: the maintainer wanted more ways to earn ceramos besides the daily reward. What: six missions (
utils/missions.ts): 25 or 100 messages and 30 or 120 minutes in voice in a day (3, 6, 4 and 8 ceramos), and 500 messages or 10 hours in voice in a week (20 and 25). The progress is the activity Petto already counts in every server (activity_members, so it follows what a server turned off and who asked not to be counted); the day and the week are UTC (the week starts on Monday). A mission pays once for each period: the claim, the wallet and the ledger change in one statement (new tablemission_claims), so two taps at once cannot pay it twice. New command/missions(list,claim) and routesGET missionsandPOST missions-claim; the movements show "Mission". Written in TypeScript;scripts/check-missions.jschecks the periods, the progress, claiming one or all, paying once and the next day. Not verified: not run in Discord or against a real database. - The questions a day of
/askfollow the plan of a person. Why: the plans listed the uses of the AI a day as Soon. What: a member with Bronze, Silver or Gold can ask 20, 60 or 150 questions a day (never less than the free limit,ASK_FREE_DAILY); with no plan, an ended plan or a plan that cannot be read, the free limit stays. Premium and the team keep having no limit.scripts/check-ask-plan.jschecks it. Not verified: not run in Discord or against a real database. - A read-only API: a person makes up to three keys and reads their own ceramos, plan and movements. Why: the maintainer asked for a documented API. What: new table
api_keys(only the SHA-256 hash of a key is kept; the key is shown once when it is made), private routesGET api-keys,POST api-key-createandPOST api-key-remove(the dashboard) andPOST public/me,POST public/movementsandGET public/info(the website, which passes the key it received). A key only reads data of its own person, changes nothing and is held to 60 reads a minute. Written in TypeScript (db/apiKeys.ts,utils/publicApiActions.ts);scripts/check-public-api.jschecks that the key itself is never kept, the limit of three, who can remove, that a removed key stops, the bad keys and the rate limit. Not verified: not run against a real database or the real website. - The team can give ceramos from the dashboard, with limits the owner sets. Why: the maintainer wanted to add ceramos from the dashboard, from the team, and that it is configurable. What: new routes
GET/POST admin/grant(the owner and the people the owner lists; the bot checks who asks) andPOST admin/grant-settings(owner only). The settings are saved in the new tableceramos_grant_settings(a switch, the most ceramos in one gift, the most a person of the team can give in 24 hours, and the list of people; the owner can always give and has no daily limit). Every gift is written in the ledger with who gave it and a note, so it shows as "Gift from the team". Written in TypeScript (db/ceramosGrant.ts,utils/ceramosGrantActions.ts);scripts/check-ceramos-grant.jschecks who may, the limit of one gift, the daily limit, the switch and the settings. Not verified: not run against a real database or the real website. /ceramos topshows the ten people with the most ceramos. Why: the maintainer asked for the top of the richest people. Only the name is shown (nobody is pinged); a person whose account cannot be found shows as someone who left. NewtopBalancesindb/ceramos.ts;scripts/check-ceramos-top.jschecks the order and the limit. Also, a pack of ceramos in the movements shows as "Pack of ceramos bought" instead of the raw word. Not verified: not run in Discord or against a real database.- Packs of ceramos can be bought (500, 850, 1,200 and 2,000). Why: the maintainer wanted people to get ceramos whenever they want, besides the daily reward and the plans. What: the catalog lists four packs (
utils/coinPacks.ts: pile 500 for $2.99, small bag 850 for $4.99, big bag 1,200 for $7.99, chest 2,000 for $11.99) and a new private routePOST /api/dashboard/ceramos/credit-packcredits one after the website confirms the payment. The credit is safe to repeat: a new tableceramos_orderskeeps every order id once and the wallet and the ledger change in the same single statement only if that order was new (giveOnce), so a payment that Polar sends twice gives the ceramos once. Written in TypeScript (coinPacks.ts,coinPackActions.ts);scripts/check-coin-packs.jschecks the packs, the repeated order and the wrong inputs. Not verified: not run against a real database or a real payment; refunds are not handled yet. - The shop starts with 5 packs of banners and 2 packs of name fonts. Why: the maintainer asked for packs from the start. Banners: GTA VI, Forza Minecraft and Halo, Sanrio and Call of Duty (free, taken whole with one click) and Cities and landscapes (800 instead of 1150). Name fonts: Retro and arcade (700 instead of 1000) and Elegant letters (400 instead of 580). They are saved the first time the bot starts and the team can edit them afterwards. A check keeps every piece pointing at a pack that exists and every whole pack cheaper than its pieces.
/rank(and!rank) shows a link button "Customize your rank" under your own rank. Why: the maintainer wanted people to find the new page where they design their rank card without having to know it exists. It goes to/dash/rankof the website, in the language of the server, and it is not shown under somebody else's rank.- A person can design their own rank card (colors of the bar and the text, font, layout, avatar shape, theme and background), and the shop comes with 21 backgrounds. Why: the maintainer showed the page "Rank card" and wanted it real: the card every server without its own design shows follows what each person saved (a server that designed its own card keeps it). The bar can have two colors (40 ceramos, paid once and kept for good); everything else is free. The shop starts with 15 free game backgrounds (GTA VI, Forza Horizon, Minecraft, Halo, Sanrio, Call of Duty, each with its credit) in the pack "Game backgrounds" and 6 landscapes that cost ceramos; the team can edit all of them afterwards and a restart never overwrites that. Rank cards a server designs can also have a bar with two colors (
accent2). New tableuser_rank_card, new columnshop_items.credit. - The plan of a person (Bronze, Silver or Gold) is saved, and it sets the daily ceramos and the places of the showcase. Why: the plans were only a number in the code (nobody could have one), and the website needed pages for them. What: new table
user_plans(the plan, when it ends, who gave it); the owner gives a plan for some days or with no end, and ends it, from the dashboard (new private routesadmin/plans,admin/plan-grantandadmin/plan-end, owner only); a plan past its end counts as none;/dailygives 5, 10 or 20 ceramos and the showcase has 2, 4 or 6 places by plan (it was already coded, now it is read).statecarries the plan with its end, the catalog carries the numbers of the three plans and there is a routeledgerfor the last movements of a wallet. Written in TypeScript (db/userPlans.ts,utils/userPlans.ts,planAdmin.ts). The uses of the AI a day, the badges of their own, the freezes of a streak and the own background are in the numbers but nothing counts them yet. Payments are not connected: until they are, the owner gives the plans by hand.scripts/check-user-plans.jschecks it. Not verified: not run against a real database or the real website. - Packs, banners and name fonts in the shop of the profile, and the team can change every badge, including the ones of the code. Why: the maintainer wanted to edit the Christmas badge and the Fablo pack (names, pictures), make packs of his own, and sell banners and name fonts like other bots do. What: a pack is a named group of badges, banners or name fonts that can be free, for a plan, for some days only (whoever bought keeps it), or sold whole for one price that is never dearer than its pieces; its days and its plan count for every piece inside. A banner (PNG, JPEG or WebP, 768 KB at most) replaces the Discord banner in
/profile, and a name font (TTF, OTF or WOFF2, 768 KB at most, checked by its first bytes) changes how the name is drawn there; both are bought once with ceramos (/ceramos shop category:banner|font|pack,/ceramos buy, which also buys a whole pack), kept for good and put on or taken off with/profile bannerand/profile font(leave them empty to go back). The shop starts with 24 name fonts, the families of the name customization of Vetox (Press Start 2P, Monoton, Cinzel, Lobster...), saved the first time the bot starts (utils/shopSeed.ts; ten more font files insrc/assets/fonts, free licenses inLICENSES.md), and from then on the editor owns them, so a restart never undoes a rename or a price. The editor of the owner can now change the words, colour, rarity, price, picture and pack of any badge of the code (countries, languages and the Fablo ones; the stars of the plans never change) and go back to the code with one button. Impact: new tablesshop_packs(the free Fablo pack is added at start),shop_items,user_items,badge_overrides, and the columnscustom_badges.pack_id,user_profile.banner_idandfont_id(all created at start withif not exists, RLS on); new private routes under/api/dashboard/ceramos/(buy-item,buy-pack,wear,item-file/:kind/:idand the owner'sadmin/shop,pack,pack-active,item,item-active,item-file,override,override-reset,override-image); written in TypeScript (db/shop.ts,utils/shopRules.ts,shopCatalog.ts,shopBuy.ts,shopAdmin.ts,shopSeed.ts). Every banner is cut to the middle of the picture and saved as a 1024 x 320 WebP when it is uploaded (a picture under 800 x 200 is refused), so its proportions are right on the profile picture, in the shop and on the rank card; the default rank card (/levels rank) now uses the banner a member has on, darkened a little so the numbers stay readable, and a server that designed its own rank card keeps its design (it can show each member's banner by using the picturepetto:user-banner).scripts/check-shop-packs.jschecks the rules, the sales, the prices of a whole pack, buying and giving the ceramos back, the size of the banners, and that the 24 fonts are real files;scripts/check-default-rank-card.jschecks the rank card with a banner. Not verified: not run against a real database, Discord or the real website; a banner or font uploaded through the website has never reached the real bot; the pictures of the new shop were drawn with test pictures. - Badges made by hand, with a limited sale, and prices that can be reached. Why: the maintainer wanted to add free and paid badges himself, and seasonal ones (a Christmas badge on sale until January 1 that its buyers keep for good), and the old prices (250) were out of reach with 2 to 20 ceramos a day. What: a badge can be made in the editor of the website (owner only) with a picture (PNG, JPEG, GIF or WebP, 256 KB at most, checked by its first bytes), its name in English, Spanish and Portuguese, a tab (the new Special tab, or any other), a rarity, a price (0 is free and takes no ceramos), the days of the sale, a plan that is needed, and a rule that gives it by itself:
voter(voted in the last 30 days) andbooster(boosts the support server) work;partnerandserver_boosthave no source yet, so nobody gets them. Before the sale starts and after it ends nobody can buy it; whoever bought it keeps it, can frame it and wear it; taken off sale by hand it is the same, and it can be put back. The badges of the editor are in/ceramos shop category:special, in/profile showcaseand in the picture of the profile. New prices: a common badge 20, rare 50, epic 120, legendary 300, bright frame 15, divine frame 40 (a day of the best plan buys a common badge, about ten days with no plan). The profile picture says the voice time with its unit (45 min,12 h,3 d 4 h) instead of a bare number. Impact: new tablecustom_badges(created at start withif not exists, RLS on, the picture in the table); new private routes/api/dashboard/ceramos/admin/*(the owner only) andbadge-art/:id; written in TypeScript (utils/badgeRegistry.ts,badgeAdmin.ts,customBadgeRules.ts,db/customBadges.ts).scripts/check-ceramos.jschecks the rules, the sales, the rule badges and the routes. Not verified: not run against a real database; the picture of a badge was never sent through the real website to the real bot. - The shop of badges has 253 countries with their real flags and 20 languages, with rarities, and the website can use the same badges, wallet and actions. Why: the maintainer wanted a page of badges on the website like the one of other bots, with every country flag. What: the countries are drawn with the flag of the open package
flag-icons(MIT, new dependency) inside the hexagon, in the shop picture and in the profile picture; the languages are drawn with their code. A badge has a rarity that sets its price (common 20, rare 50, epic 120, legendary 300; all current ones are common; a day of the best plan buys a common badge, and about ten days with no plan) and a tab (countries, languages, Fablo pack, status)./ceramos shoptakes acategoryand apage(18 badges a page). New private routes of the bot for the website, under/api/dashboard/ceramos/(catalog,state,daily,buy,upgrade,identity,showcase): they check the secret of the website, take the person from the login of the website, limit writes to 40 a minute and run the same code as/ceramosand/profile(utils/ceramosApi.ts,profileActions.ts), so the website and Discord cannot disagree. Written in TypeScript.scripts/check-ceramos.jschecks the catalog, every flag file, the routes and their limits. Not verified: not run against a real database or the real website; the routes were called with Discord and the database replaced. - Ceramos: a wallet,
/daily,/ceramosand a shop of badges with frames. Why: the maintainer wanted a currency for the profile (badges, and later backgrounds and rank cards) that people earn every day and spend. What:/dailygives the ceramos of the day, once for each UTC day: 2 with no plan, 5 with Bronze, 10 with Silver and 20 with Gold./ceramosshows the wallet as a picture (balance, when the next daily opens, last movements);/ceramos shopshows the badges for sale (countries and languages, drawn with their code until they get art);/ceramos buy badge:...buys one for 20 ceramos, and it is the person's for good (no daily cost, no expiry);/ceramos upgrade badge:...gives a badge a better frame, one step at a time: bright (15) and divine (40), a gold ring and a glowing double rainbow ring in the profile picture. The badges of the Fablo pack can be framed too; the badge of a plan cannot./profile showcasetakes the badges the person has (a list that fills in as they type, because there are more than Discord lets a list of choices hold). The owner has a hidden tool,!ceramosadmin give|take|balance @user amount [note], that is not a slash command: it writes who did it in the ledger and a take never goes below zero. Impact: new tablesceramos_walletsandceramos_ledger(created at start withif not exists, RLS on) and two new columns in the newuser_badges(frame, andshopandstatusas sources); every change of the balance is one statement that also writes the ledger, so two commands at once cannot spend the same ceramos, and a purchase that cannot be finished gives them back./ceramosand/dailyare in the second set of slash commands (registered in each server). Written in TypeScript (src/utils/ceramos.ts,ceramosShop.ts,ceramosImage.ts,src/db/ceramos.ts, the commands).scripts/check-ceramos.jschecks it. Not verified: only tested with Discord and the database replaced; the pictures were drawn with sample numbers and the account of the maintainer; nobody can have a plan yet, so everybody gets 2 a day for now. Still to come: the badges that follow what you are (partner, voter, booster, server boost), the read-only API for other bots and its documentation, the team panel in the dashboard, and buying with the web. /profileand!profileare a picture now: avatar, banner, name with the star of the plan, level, rank, messages and voice time (with its unit:45 min,12 h,3 d 4 h) of the server, and a showcase of badges. Why: the maintainer wanted everything the bot shows in a server to be a picture, and a profile people can put badges on. What: the picture is drawn without a ring around the avatar; the showcase has six hexagons, and the plan decides how many are open (one with no plan, 2 with Bronze, 4 with Silver, 6 with Gold; the rest are drawn with a lock). The badges are the three stars of the plans (they follow the plan, nobody picks them) and the Fablo pack, four free identity badges (Furro, Boykisser, Hetero and Femboy), that each person turns on or off with/profile badgeand orders with/profile showcase(a new one goes to the showcase when there is a free place; one you do not own, or with no place, is left out and the answer says so). The old text card (rating, uploads, requests, partnerships) is/profile server(!profile server @member);/profile config ...does not change. Impact: new tablesuser_badgesanduser_profile(created at start withif not exists, RLS on), written in TypeScript (src/utils/profileBadges.ts,profileImage.ts,profileView.ts,src/db/userProfile.ts). The plans of a person are not sold yet, so for now everybody has the free place only; every badge has its own art (Hetero shows the female and male symbols).scripts/check-profile-card.jschecks it. Not verified: the picture was drawn with sample numbers and the account of the maintainer, not from a real server; the command was not run in Discord (only built and checked with Discord and the database replaced).- Petto can be installed on a person:
/action,/avatar,/banner,/userinfoand/birthdaywork in any server, in direct messages and in group chats, even where Petto is not a member. Why: the maintainer wanted people to use the fun and info commands without adding the bot to a server ("Add to my apps"). What: those five commands say they can be installed on a server and on a person (src/utils/userInstall.ts), and/avatar,/banner,/userinfoand/birthdayare slash commands of their own now (before, only/user ...and/me birthdaywere). Where Petto is not a member nothing of the server is read: the language is the one of the person's Discord,/actionsends the action without the counters and the answer button,/userinfoshows the account without the part of the server, and/birthday set,viewandremovekeep a personal birthday (new tableuser_birthdays, created at start withif not exists) that only its owner sees;upcomingandconfigsay they need a server. Every other global command now says it is for servers only (integration_types: [0]), so turning "User Install" on in the Developer Portal does not put them in people's menus. To use it, the maintainer turns on User Install in the Developer Portal (Installation) and keeps the install link withapplications.commands. Impact: to make room for the four slash commands (at least 9 global slots stay free),/clearinvites,/pauseinvites,/stripstaffand/giveawaypresetmoved to the second set (registered in each server,guildScoped): they work the same.scripts/check-user-install.jschecks it. Not verified: only tested with Discord and the database replaced; it has not been tried from a real user installation, and the custom emojis of the cards may not show where the person has not got them. /247: Petto stays in a voice channel of the server for good, with a status on the channel. Why: the maintainer wanted the bot to sit in a voice channel all the time, with "Watching the server 24/7" written on it. What:/247 set channel:#voice [status:text] [deaf:yes/no](or!247 set) sends Petto to the channel, muted and by default with the sound off, and writes the status of the channel (the default text is in the language of the server: "Watching the server 24/7";/247 status text:defaultgoes back to it)./247 infoshows where it is and/247 offmakes it leave and clears the status. It is saved in the database (new tablestay_voice, created at start withif not exists), so Petto comes back by itself after a restart, and a job looks every minute (first look 30 seconds after the start); if somebody moves or kicks it, it comes back in a few seconds. The music has its own connection: while it plays in the server,/247waits and comes back when it is over. It needs Manage Server, and Petto needs View Channel and Connect in the channel, and Set Voice Channel Status to write the status (without it Petto stays in and says what is missing). It is a slash command of the second set (guildScoped, registered in each server), written in TypeScript.scripts/check-stay-voice.jschecks it. Not verified: only tested with Discord and the database replaced; joining a real voice channel and writing the status in Discord has not been tried yet.- The bot publishes the servers of the carousel of the home page: 500 members or more, the biggest first, at most 15, with name, icon (animated when it is), members, members online and the badge the Discord app shows for it (partnered, verified, discoverable, community, or the boost level; boosted looks for discoverable and community). Why: the maintainer wanted a carousel with the biggest servers on the website. It goes in the row
mainofglobal_stats(keyshowcase), made again every minute by the global stats job (the online members are asked again every 5 minutes: one request for each server). A server that chose to be left out of the public numbers (global_stats_hidden) is never in it; when a bigger server appears, it takes the place of the last one. - A category
@ statsin the support server (PETTO_SUPPORT_GUILD_ID) with two voice channels,Members • 12,480andServers • 12, that everybody sees and nobody can join. Why: the maintainer wanted the numbers of Petto visible in the server. It is made when the bot starts (45 seconds after, with the servers in the cache) and the numbers are updated every 10 minutes, because Discord lets a channel be renamed only twice in 10 minutes. WithoutPETTO_SUPPORT_GUILD_ID, or without Manage Channels there, it does nothing and says so in the log. - A member can be blocked from XP:
/levels manage block user:@member. Why: the maintainer wanted a leaderboard where one person (alegis) can never get XP, not by chatting and not because somebody gives it by hand. What: a blocked member earns no XP for messages, for voice or from the starting bonus, and/levels manage xpand/levels manage levelrefuse to give or take XP or levels for them (also as the destination or the source of a transfer); their XP stays as it is, andresetstill works. The same command lets them out again; without a member it lists who is blocked (up to 100 members), and/levels statusshows the list. It is!levels manage blockwith the prefix. Impact: new columnlevel_config.no_xp_user_ids text[], created at start withif not exists; written in TypeScript (src/utils/xpBlock.ts). The dashboard page of Leveling has the same list (web pull request).scripts/check-xp-block.jschecks it (it fails without the rule). Not verified: only tested with Discord and the database replaced.
Changed
- The frames of the badges are three real pictures (iron, gold and mithril), drawn bigger than the badge, which keeps its size. Why: the frames were only a gradient. What:
profileImage.tsdraws each frame 16 % larger than the art; the old Bright frame is called Golden now. - Your own rank card shows in every server. Why: the maintainer said a person who pays for a custom rank must see it in the server, even when the server has its own card. What:
renderRankCarduses the card of the person when they have a design and the card of the server only for the others (check-user-rank-card,check-animated-rank-card). - The detector looks at up to 5 frames of an animated picture. Why: one frame could miss something hidden in the middle of a GIF. What:
animatedPicture.tsgives evenly spaced frames (samples),imageScreen.screentakes a list (up to 8 inputs in one request) and any yes in any frame counts; a missing answer for a frame leaves the whole picture as not checked. /streaklists the rules of the server (minimum length, cooldown, channels, roles, reactions) when they are on, in English, Spanish and Portuguese.- The
/profilepicture shows the Petto background when the person has no banner (a banner of the shop or of Discord). Why: the maintainer asked for the background that Petto uses when there is no banner instead of a plain dark gradient, the same one the preview of the website shows. - The banner of the profile fills the whole
/profilepicture. Why: the maintainer showed how Vetox does it and the strip on top with a dark band under it looked wrong. The banner is now behind the avatar, the numbers and the badges, a little darker toward the bottom, and the numbers and the badges sit on dark glass so they stay easy to read. - The default rank card and the default welcome cards have no ring around the avatar. Why: the maintainer asked for the avatar to be drawn clean, as in the profile picture; the three basic layouts (rank, rank with the bar at the bottom, and the centered welcome) still drew a ring in the accent colour. Cards a server designed itself are not touched (a layer can still have a border). The dashboard preview uses the same layers (
src/react/cards/basicLayers.ts), andscripts/fixtures/card-presets.jsonwas copied again. /counting,/counter,/imageonlyand/linkonlyare slash commands of their own;/specialchannelsis only for the prefix now. Why: they were found only as/specialchannels counting setup, and the maintainer wanted/countingto be typed as it reads. The four are registered in each server (the second set,guildScoped), so the 100 global slots do not run short (10 stay free).!counting,!counter,!imgonly,!urlonly,!specialchannels ...and the short words keep working; the two commands now namedimageonlyandlinkonly(filesimageonly.js,linkonly.js) keep the old words as aliases and the rules a server saved under them.- No notice of Petto to the staff is sent to the owner by direct message any more. Why: when a server had no private log channel, the notices (a feed switched off, a verification role that could not be given, a diagnostic, a permission problem) went to the DMs of the owner, filling them with messages nobody asked for. Now they go only to the private staff/log channel of the server; without one they are not sent (the Petto team still sees the alert, and the permission problems are in the Overview of the dashboard). The notice of a blacklisted server and the report of an anti-nuke incident are not touched.
- The AI helper of the Migrate page knows Nekotina by name. Why: the web page now converts Nekotina messages, and the helper said "another bot" for it, so it could not tell the person which syntax to expect. It already knew MEE6, Carl-bot, Dyno, ProBot and Welcomer.
- When Petto is removed from a server, everything it stored for that server is deleted within 5 minutes (before: 3 days). Why: a server that removes Petto is asking for its data to go, and keeping it for days, or for longer when it had backups or a Premium slot in use, was more than needed. The cleanup now looks every minute (before: every 6 hours) and deletes the servers that left more than 4 minutes ago, so all of it is gone at most 5 minutes after: the settings, the logs, the backups kept in the database and everything tied to the server, with no exceptions. A server that adds Petto again inside those minutes keeps everything. The servers that were waiting for their 3 days are deleted at the first pass after the bot starts (about 2 minutes after). What a person bought (the Premium slots and their requests) is not data of the server and stays, as does the blacklist.
GUILD_PURGE_MINUTESchanges the wait (4 by default, 1 to 60);GUILD_PURGE_DAYSandGUILD_PURGE_BACKUP_DAYSare gone. The guards stay: nothing is decided while the bot is not ready or has loaded fewer servers than Discord says it is in, andGUILD_PURGE=falseandGUILD_PURGE_DRY_RUN=truestill work. - The pictures of
/statsshow the icon of the server next to its name. Why: the cards only had the name; with the icon a server is known at a glance, as in other statistics bots. It is the same top for every/statspicture (overview, heatmap, growth, compare, channels, members and the two of a member); a server without an icon, or an icon that cannot be loaded, is drawn as before. - A server that has not turned a log on is no longer asked about it: no audit log request and nothing built for it. Why: for every join, leave, mute or move in voice, and for every edit and delete of a message, in all the 240 servers, the bot asked Discord's audit log who did it (34 places, a request each) and built the whole embed, and only then looked whether the server had that log on. Now the log files ask first (
logsEvent, from the configuration that is kept in memory) and the audit log requests carry the event they are for (fetchMod(..., { event })); the voice log and the message log (delete, edit, bulk delete) leave at once when the server has not turned them on. The tickets, which use the audit log for their own work, are not touched. If the configuration cannot be read it works as before. The configuration of the logs is kept 15 seconds, not 5 (a command that changes it forgets it at once; a change from the dashboard is seen within 15 seconds). - Petto keeps the messages of a server in memory for ten minutes, and for an hour only in the servers that have the log of messages on. Why: the bot was using about 600 MB with 240 servers. Every message it sees is kept (100 for each channel), a cached message costs about 2 KB, and all of them stayed for an hour, but the only thing that reads an old message is the log of messages (the text of an edited or deleted message);
!snipeand the rest keep their own small stores. So a server without that log held its messages for nothing. The servers with the log are read from the database every two minutes (and a server that turns it on is noticed at once); until they are read, and if the reading fails, nothing is swept earlier than before. The sweeper passes every two minutes now (it was ten). /stats memberis now two pictures: a profile card and a card of charts. Why: a plain message cannot show a member's activity well. The first picture has the name and avatar, when the account was created and when the member joined, the rank in the server for messages and for voice, and the messages and voice time of the last day, 7 days and 30 days. The second has the streak, the active days, the average per active day, the best day, and a chart of messages per day and another of voice hours per day. The member's voice time is counted too now, not only messages. The default window is 30 days, in the three languages. The cards are made only when the command is used.!perfsays what each cache weighs. Why: to see which one is the big one without guessing: the members, the presences and the messages show an estimate in MB next to their number (measured with the discord.js of the bot).- The messages of a new server, and the guide of the owner, name every command as a slash command and show Petto's face as it is in the server. Why: the prefix may stop working one day, and the message still said
!help,!logsand!welcome. Now they point to/help,/logs,/automod,/greetand/language(clickable when Discord lists them), the picture next to the text is the avatar Petto has in that server (a Christmas one, for example) instead of a picture kept in the code, each line has its icon, and the invitation to the support server is in the buttons and in the text. - The language buttons and hints say
/language, not!language. - The Currently log looks at the web every two minutes, not every ten. Why: a change that is merged and deployed reached the channel up to ten minutes later, and it looked as if it had not been posted. It is a small read of the file of the log, so it costs nothing.
- The card of the improvements has the arrow that goes up, not the two circular arrows. Why: the circular arrows (the icon of reload) looked like a clock and said nothing about an improvement.
- Four packages are updated:
@napi-rs/canvas1.1.1,dotenv18.0.10,express-rate-limit8.7.4 and@polar-sh/sdk1.3.0. Why: the automatic update pull requests (#479 to #482) were open; they are done here together, in one change, and checked with the wholenpm run check.@polar-sh/sdkis a major version (0.49 to 1.x) and asks for Node 24; the bot does not import it anywhere yet, so nothing in the code changes. !level rolesand!level rewardsshow the roles given at each level, like!level reward listand/level reward list. Why:!level rolesanswered "I could not find roles" and suggested!level rules, which is another thing. It is the same route, so the prefix and the slash command answer the same.- The Currently log reads its changes from the web, every ten minutes, so a change of the web reaches Discord by itself. Why: the changes were in a file of the bot and were posted only when the bot started, so a change that only the web had never reached the channel. They are now in the web repo (
src/data/currentlyLog.json, served atpetto.sbs/api/currently-log;CURRENTLY_LOG_URLchanges the address): the bot looks at it when it starts and every ten minutes, and posts what is new. If the site cannot be read, nothing is posted and it is tried again at the next look. The file of the bot is gone. - The version at the bottom of the Currently log cards is the one written in
currentlyLog.json(0.7.12), not the one ofpackage.json. Why: the log has its own start: every announcement from the message that says "0.7.12" on is 0.7.12, until the maintainer says that 0.7.13 starts, and then that number is changed in the file. - Every card of the Currently log gets the like and the dislike of the feedback board as reactions. Why: so people can say whether they like a change with one click. They are the same two emojis the buttons of a feedback post use; if a reaction fails, the log goes on.
- A sticky message saved in the dashboard is posted right away. Why: the dashboard only saved the row, so the message appeared the next time somebody wrote in the channel (
!stickymessage setalready posted at once). The dashboard now tells the bot onpetto:sticky; the bot forgets the cached sticky, deletes the old message and posts the new one. Only one process does it, once per burst. Without Redis it works as before. /guildtagand/vanityare in the menu for everybody, and ask for Manage Server when they run. Why: with the permission set in the command, Discord hid them from every member who does not have Manage Server (a moderator saw no/guildtagand thought it did not exist). Now it is the bot who checks, with the slash and with the prefix, and says which permission is missing.- The card of a case (
/case view,/case edit, and the one-line case) shows the hammer for a sanction and the alert for a warning, not the old icon of each type. Why: the list and the confirmation of a sanction already used the generic icons, but the detail of a case still drew the old ones (the ban, kick, mute... icons), so the same case looked different in each place. - A confession can carry up to 10 pictures, not one. Why: the form of the Confess button took one picture and the maintainer wanted more (the file upload of a form takes up to 10, and so does the gallery of a message). What: the file upload of the form takes up to 10 pictures; the confession shows them in one gallery, each one as its own file (
confession-1.jpg,confession-2.jpg...), and the card of the staff shows all of them too; the files that are not pictures are left out. They all have to fit in one message, so together they are limited to what a server accepts (9 MB, 49 MB with boost level 2, 99 MB with level 3), each one up to 6 MB: the ones that do not fit are left out and the member is told./confess sendand!confessstill take one file (the option of a command is one file), and a custom design from the dashboard shows the first picture only (its layout is its own).scripts/check-confessions.jschecks one, three, twelve (ten go), a document among pictures, the card of the staff, the size limit and a boosted server. - The card of a priority error has its title in three
#(###), not two. Why: the maintainer finds the one and two#titles too big and too noisy in the channel of errors, and prefers bold or three#. What:Petto priority erroris### ...(src/utils/priorityErrorLog.js);scripts/check-error-triage.jschecks that the title has three#and that no title in the card has one or two. The quest cards and the rollout alerts keep their titles on purpose. - The form of a confession lets you drop or attach the picture itself, instead of asking for a link. Why: the "Confess" button opened a form with a box for "a link to a picture", so to send a picture you had to upload it somewhere first;
/confess sendalready took a real file, and the questions of a ticket already have the file upload of a form. What: when the server allows pictures, the form has the file upload of a form (one picture, optional) under the text, built the same way as the ticket questions; a link to a picture written inside the text still works, and the form of an anonymous reply still has no picture. A file that is not a picture (png, jpg, gif or webp) is refused with a message instead of being left out in silence. A form that was open before this change (the text box for a link) still sends.scripts/check-confessions.jschecks the form (a text and a file upload of type 19, none when the server does not allow pictures, none in a reply), a dropped picture, a document, no file and the old form. - The voice leaderboard shows a short time:
5H 30min, not325 voice minutes. Why: with many hours in a voice channel the number of minutes is hard to read (and a board with 80,000 minutes says nothing at a glance). What: a time in voice is written as hours and minutes (5H 30min,5Hwhen no minutes are left over), as minutes alone under an hour (45min), as seconds alone under a minute (30s), and the most is hours, never days (1,350H, not56 days). The letters are the same in English, Spanish and Portuguese (leaderboards.unit.hours,minutesandseconds; the oldminutessaidvoice minutes, the title of the card already says it is voice), and the number is written as each language writes it. Impact: no table or column; every voice card says something different after the update, so each voice board is edited once (through the budget of writes to Discord, with the rest of the boards); the chat boards do not change. Not verified: only tested with Discord replaced. - An activity leaderboard is one message, with a card for each period in it, and the boards that exist become one message when the bot starts. Why: a board with the month, the week and the day was three messages in the channel (and three edits every time the numbers changed), and the maintainer wanted them together. What: the cards of the periods the server chose (one, two or three) are in ONE message, one under the other (Components V2, a container for each card, month first and day last, same look); an edit is one write instead of up to three, so the same budget of writes to Discord holds three times as many boards. A period that is taken away or added is only an edit of that message (before it deleted and posted everything again). A message of components holds 4000 characters of text in all: with ordinary usernames the three cards take about 3400, and only when long usernames and big numbers would pass 3900 every card shows one place less (never fewer than 3) so the message is never refused. The boards that were written the older way (a message for each period) get their one message posted first and the old ones deleted after, so a board is never left with nothing; it happens when each board is looked at after the bot starts, a few at a time (the new message and three deletes are four writes for each board, through the same budget, the oldest first), and
/activityboard refreshdoes it at once for a server./activityboard removeand a change of channel delete the message and the old ones. Impact: new columnactivity_leaderboards.message_id text, created at start withif not exists(the three old columns stay and are emptied as each board is converted); the memory incard_stateis now one hash for the message (the memory of the older way is not used and is replaced, so a board that exists only starts remembering and is not edited by that); the dashboard has to be updated too (its own pull request): until then, a channel changed from the dashboard leaves the old message in the old channel. Not verified: only tested with Discord and the database replaced; how Discord shows three containers in one message was not seen in a real server; the 3900 limit was measured with the text of the cards, not with a message refused by Discord. - Activity leaderboards keep their 5 minutes with thousands of boards, and never fill the queue in front of Discord. Why: the job looked at 60 boards a minute, one at a time with a pause of 1.5 seconds after each one that wrote, which is about 300 boards in 5 minutes; with thousands of boards one turn would have taken many hours (worse than the hour it was before), and a board whose server was not reachable was never marked, so enough of them would have stayed first in line and stopped the rest. What: the job looks every 15 seconds and, in a look of up to 50 seconds, goes through the due boards (oldest first) 4 at a time, asking again while more are due; the three tops of a board are read in one trip (
readTops, the days of the month are read once) and the boards of a batch are saved in one statement (flushRefreshed), so a board that has nothing new costs one read and a share of one write (it was three reads and two writes). What a look may write to Discord goes through a budget of writes a second,PETTO_ACTIVITY_BOARD_EDITS_PER_SECOND(half ofPETTO_REST_RPS, 4 a second by default): the host shuts the app down over 300 requests in 30 seconds, so when more cards have to be written than the budget allows the oldest boards go first and the rest wait for the next look instead of failing the logs, the timers and the answers to commands behind them; a warning in the log (at most every 10 minutes) says when a board waited more than 10 minutes. What each card said is kept in the database (activity_leaderboards.card_state, a short hash and the moment), so a restart of the bot or a deploy no longer edits every card once, and a board older than that memory only starts remembering, at a time spread over the next hours. A card that has not been written for 6 hours is edited anyway to find a deleted one (it was 1 hour; when the numbers change the edit finds it at once). A board whose server is not reachable counts as looked at. Impact: new columnactivity_leaderboards.card_state jsonband an index onlast_refreshed_at, created at start withif not exists; the limit is Discord's and the host's, not the bot's: with the default budget the bot writes at most about 1,200 cards every 5 minutes (400 boards if all three cards of every board change at every look), and more boards than that wait their turn, so the 5 minutes only hold when the cards that really change fit in the budget (a quiet board writes nothing); more needs a higherPETTO_REST_RPSthat the host allows. Not verified: only tested with Discord and the database replaced (the speed of the look was modelled with assumed times for the database, 440 boards a second); the SQL ofreadTopsandflushRefreshedwas checked for its shape and not run against a real database; the real number of cards that change in 5 minutes was not measured.
Fixed
- Streaks counted the day in UTC; Petto uses Colombia time (GMT-5). Why: the days of the activity (
botDay) and the streaks did not match, so a streak could break or grow at the wrong hour. What:utils/streaks.tsusesbotTime.botDay, the hours left to save a streak use the same day, the counting rules start only whencounting_sinceis set; the texts of the dashboard and the wiki say GMT-5. - A name font of the shop is drawn at its real size on
/profile. Why: the font was put in front of a font string that already had its size, so the string was not valid and the name came out tiny (10 px) in the default font instead of the font the person bought. It is checked now by counting the ink of the name. /embed createwith a very long name no longer fails with "Invalid string length". Why: the buttons of the embed editor carry the name of the embed in their custom id, and Discord refuses one of more than 100 characters; a name of about 60 characters or more made the editor throw (and the embed was already saved, so it could not be opened). What: the name has a limit of 50 characters (Discord stops it in the option, and the command says it in the three languages if it still comes in, before saving anything). An embed saved before with a longer name now answers with what to do (delete it and create it again shorter) instead of failing.scripts/check-embed-name-length.jschecks it (it fails without the fix).- The letters check inside Discord answers the form at once, so a busy bot no longer fails it with "Unknown interaction". Why: after the member typed the letters, the bot looked up the language, the member, the checks and gave the roles before answering, and Discord only waits three seconds for a form; when the bot was slow the member could be verified and still get no answer, and the log showed "The picture of a verification could not be locked" and "Error handling the verification form". Now the form is answered first, then the picture is locked and the member is told; a form that still arrives too late changes nothing and the member tries again.
/247from the dashboard: Petto now joins the voice channel within 20 seconds, even when the bot is busy. Why: the job that puts Petto in the channel looked every minute and was one of the jobs the load guard pauses when the bot is under load, so on a loaded bot a switch turned on in the dashboard could leave Petto out of the channel. It is now an essential job, looks every 20 seconds, and writes one line in the log each time the result of a server changes ("is in" or why it is not).- A Premium granted to a person from the dashboard is theirs, not the owner's. Why: the dashboard saved every Premium granted by hand with the owner of Petto as its holder (
user_id), and put the person only in its key (manual:user:<id>), but the bot looks for a person's Premium byuser_id: the list of the Premium that is active at start showed the owner three times, the person had no Premium (no role, no slots, nothing in!premium) and the owner had it. What: the dashboard now saves the person as the holder (also when an old grant is edited); when the bot starts it repairs the ones saved before (schema.sqlchanges the holder of the grants whose key saysmanual:user:<id>and of the slots they hold, once; nothing is left to do after it); the list at start and the new records of Premium name who the Premium is for (the key says it) and a Premium for a server names the server; the role goes to the person, and a Premium for a server gives no role.scripts/check-premium-watch.jsandscripts/check-premium-log.jscheck it (they fail with the old reading). Impact: no table or column; a Premium granted to a person before this has its holder changed from the owner to the person the first time the bot starts, so the owner loses the role that came from it and the person gets theirs within 2 minutes (the watch of the Premium does not record this repair). Not verified: the repair SQL was not run against a real database (only its text is checked). - A Premium granted by hand (from the dashboard or
!premiumadmin) or bought gets its role at once, and every change has a record in the Premium channel of the team. Why: the role was given by a job that looks every 2 minutes, and a grant made in the dashboard did not give it at once; and the Premium channel only had the list of what is active, written once when the bot starts, so a grant, an extension or a revoke left no record. What: a new job (premiumWatchJob, TypeScript) looks every 15 seconds at the entitlements that changed; for each one it gives or takes the Premium role of that person right away and writes a card inPETTO_PREMIUM_LOG_CHANNEL_IDwith the Premium gem, the person (with their avatar), the plan, the slots, the end date, the source (manual and who granted it, or Polar) and what happened to the role. It records a grant, a change (more slots, a new end date, a renewal), a revoke, an ended subscription and an end date that passed. The first look after a start only remembers how everything is, so nothing old is repeated; the list at start stays as it was. Without the channel set, the roles are still given and nothing is written; a failed role or record never stops the other. Impact: no table or column; one small query every 15 seconds (paused when the bot is degraded). Not verified: only tested with Discord and the database replaced; the card was not seen in a real server (the picture of the Currently log is a drawing of it). - A quest is announced only when the main list has it, so every alert carries its limits and its pictures. Why: the alerts went out from whichever of the five quest lists saw a quest first, and the other lists do not say the countries or the age limit, so the first alerts had no limits (they showed only in
/quests, some minutes later) and sometimes no decoration picture. What: the compact list (agnonotdev's gist) is the only one that announces; a quest the other lists see first waits, without being marked as seen, and is announced as soon as the compact list has it (with its countries, its age gate and its pictures). The other lists still fill the blanks and keep/questscomplete. The decoration picture of the compact list (avatar-decoration-presets) is used, and the sku that only the other lists have is kept so the picture can still be found. A fallback covers a main list that stops: if it has had no new quest for 7 days (counted from the last quest it had), the other lists announce too (without limits, if the main list does not have them) until the main list has a quest again; the same happens if the main list has the quests the fallback announced. Impact: new columnquest_seen.via_fallback boolean not null default false, created at start withif not exists; if the compact list stops answering, no quest alert is sent for the first 7 days (the bot says it once every 6 hours in its log, and once again when the fallback starts; the address is changed insrc/utils/questApi.js); right after the update the 7 days count from the last quest already remembered, so if the main list has been silent for more than a week, the next quest that only the other lists see is announced without waiting. Not verified: only tested with the lists replaced (a fake answer for each); how long the compact list takes to have a new quest, compared with the others, was not measured, and a real alert in Discord was not seen. - The "Audit logs" step of the setup no longer fails. Why: the log category of forums was added to the bot but not to the constraint of the table
log_entriesof the database, so saving it was refused ("violates check constraint log_entries_event_check") and the step failed in the log of a real server. The constraint now allowsforums. - The official AutoMod rules after the fifth are created, not lost. Why: Discord lets one person create 5 rules every 30 seconds; the REST client of the bot rejects at once a wait longer than 15 s with a
RateLimitError(no status), and the AutoMod code only retried a 429 or a 5xx, so the rules after the fifth failed with an empty reason. Now aRateLimitErroris waited (the time Discord says, up to 35 s) and tried again. - A Reddit feed is not switched off as "the account no longer exists" when Reddit only says 404 to the bot. Why: Reddit answers
404 Not Found(an empty feed) to a request it does not like, even for r/pics, and the first 404 ended the reading; six in a row switched the feed off (r/Bondedpairs, which exists). Now a 404 of the feed addresses is believed only when the JSON address says it too; otherwise it counts as a refusal (blocked) and is tried again. /levels manageno longer crashes with an absurd number. Why:/levels manage level set 20000000000made an XP of 2.5e30, the database refused it (error 22P02,invalid input syntax for type bigint) and the command failed with a priority error. What: a level above the maximum level of the server, or any XP that does not fit in the column (9,007,199,254,740,991), is refused with a message and nothing is saved; transfers check both members before saving either.scripts/check-level-command.jschecks it (it fails on the old code).- A channel Petto cannot see is not shown as "deleted" in the dashboard. Why: Discord now shows the channels a bot cannot view only in outline (
___hidden___), and the dashboard, which leaves them out of its lists, called a saved choice that pointed to one (a log, a feed, a honeypot...) a deleted channel. The saved copy of each server now also keeps the ids of those channels, so the dashboard says "no access" for them. The pickers still do not list them. - The pictures of a change of the Currently log are really checked before it is posted, and left ready for Discord. Why: only the header of each picture was asked, so a file that was not an image, was cut or too big could pass, and the first time a picture was asked the cache of the web had to go and get it while Discord looked at the three pictures of a change at once and did not wait, so one of the three could show broken for good. Now the whole file is read the way Discord asks (it has to answer, be an image of a size Discord takes and start like one, with a second try), which also leaves it in the cache; a change whose picture does not pass waits, as before.
- A bulk role job no longer stops with an unexpected error when the roles of the server are not loaded yet. Why: the priority error
Cannot read properties of undefined (reading 'permissions')came from adding up the permissions of Petto incheckTargetRole: discord.js reads them from the roles of the server,@everyoneincluded, and a server whose roles were not loaded (it had just come back, Discord was slow) has no@everyone. The job now loads all the roles first, and if they still cannot be read it says so ("I could not read the roles of the server") and can be started again. - The color card says why it has no sample picture when Petto or the member cannot attach files in the channel. Why:
/search colorand!coloruse the same code and draw the same card with a picture, but in a channel without the Attach Files permission the picture was left out without a word, so the same command looked different in two channels. The card now carries the reason (the same one the image commands give). - The log of a sanction that ends by itself (a timed mute or ban whose time is up, a jail released) shows the name, the ID and the avatar of the person at the top, like the log of a new sanction. Why: the job that lifts the sanction only knew the ID, so the log had no name or avatar. It now asks Discord for the user (a member who left or a banned user is not in the cache); only an account that Discord no longer knows keeps the ID alone.
- The transcript of a ticket shows forwarded messages. Why: a forwarded message has no text of its own (Discord gives the original as a copy), so the transcript drew it as "No text content". It now shows what the forward carries (text, embeds, files, stickers) under a "Forwarded" mark with the date of the original, and a reply to a forward quotes its text. The live view of the ticket in the dashboard shows it too, with an arrow before the text.
/purge all_channelsalso cleans the open threads and the posts of forums. Why: it only went through the list of text channels, and threads and forum posts are not in that list, so what was written there stayed. It now asks Discord for the open threads (up to 100) and scans them like the channels (the same permission checks, and they are in the confirmation). An archived thread is left alone: nothing can be deleted there until it is opened again.- A ban with the messages of the member deleted answers first, and deletes them after. Why: Discord deletes the messages while it sets the ban, and with many messages that takes a long time, so the notice "done" and the log came late. The order is now: the notice in DM, the ban alone, "done", the log, and then the messages are deleted in the background (the same ban is set again with the days of messages). It is for
/banand/tempbanwithdelete_message_days; if Discord refuses the deletion it is said in the log. - A sticky message comes back down when a bot or a webhook writes in the channel, not only when a member does. Why: the sticky ignored every author that was a bot, so a channel where bots (a counting bot, a feed, a webhook) did the talking left the sticky far above. Now every message brings it down; the sticky of Petto itself is told apart, also in the moment before the request that sent it has answered, so it never starts another pass.
- The Currently log is posted again, and a post never waits with broken pictures. Why: the first posts came out one minute before the web finished its deploy, so Discord looked for the pictures, did not find them, and kept them broken. Now the bot checks that every picture of an entry loads before posting it (that entry waits and is tried again every ten minutes, up to an hour), it remembers the message of each card, and a higher
revisionincurrentlyLog.jsondeletes the cards of the log (the remembered ones, and the older ones of the bot that end with the footer of the log) and posts all of it again. This revision is 3. /forumused outside a post of a forum says so to the member, and it is not a priority error. Why: a member who wrote/forum reopenin a normal channel got the generic "something went wrong" and the team got a "priority error" for what was only a wrong place; the error already had its own sentence for the member, which was thrown away.!c <id>opens the cases (!case) and not the calculator;!calcand!calculateare still the calculator. Why:cwas the short word of the calculator, so!c 2935047265057312(a member or moderator ID) answered with a calculation.- The line "Their latest cases:
/mhistory <id>" of/case statsnames a command that exists:/mhistoryand!mhistory <moderator>, which show the cases a moderator has given. Why: it said/mhistorywith the slash, butmhistoryonly worked with the prefix, as a shortcut of!case search. It is registered in each server (the second set), so the free global slots stay free. /message pagination createfailed withOption "channel" is of type: 7; expected 3. Why: the command read itschanneloption as text (getString), but as a slash command that option is a channel (type 7), and discord.js refuses to read a channel option as text, so everycreatewith a channel chosen from the menu raised a priority error and answered nothing (with the prefix the channel is written as text, which is why!pagination createworked). What:channelIdOfreads it as a channel first and as text second.scripts/check-pagination.jschecks it with the real option resolver of discord.js. The other commands were looked at for the same mistake (an option read as text that the command defines as a channel, role, user or number): there is none.- At the approval the picture is taken from the message of the button, which Discord hands over with fresh links, and the confession no longer goes without it. Why: the confessions that the staff approved still came out without their picture ("The picture of confession ... could not be had") and there was no warning of a copy that failed: Petto did not find the link of the picture at all, because it asked for the card by its id and read only its list of files, and a card of Components V2 may list none. What: the pictures are looked for first in the message the Approve button was pressed on (
interaction.message), then in the card asked for by its id, then in the link kept; they are read from the files of the message and, when it lists none, from the gallery of its components.scripts/check-confessions.jschecks the message of the button, a gallery with no files, and several pictures. - The picture of a confession that waited for the staff did not come out when they approved it, and nobody was told why. Why: at the approval Petto opened the link that was kept when the card was sent, but Discord changes the signature of a link with time, so an old link may not open, and when the picture cannot be copied (too big: up to 6 MB; not a PNG, JPEG, GIF or WebP; the link did not answer) the confession went out without it and the member never knew; the log said "the picture of a suggestion" whatever it was. What: at the approval the card the staff got is asked first (its link is the fresh one) and the kept link is the second try; when a picture the person asked for could not be copied, the confession is still sent and the answer to the member says so (
confessions.pictureLost, in the form of the button,/confess sendand!confess); and the log saysthe picture of a confession could not be copiedwith the reason (a size, a status, or that it is not a picture) instead of naming suggestions. The Approve and Reject buttons of the staff card also answer Discord first (deferUpdate) and edit the card after, because copying the picture and posting could take more than the 3 seconds a button has to be answered (updatewould have failed late and left the card with its buttons).scripts/check-confessions.jschecks an expired link with a fresh one on the card, the kept link when the card cannot be read, the note to the member and the order of the answers of the buttons. - A confession with a picture that waited for the staff failed to post when they approved it: "the referenced attachment (attachment://suggestion.jpg) was not found". Why: the card for the staff is sent through a webhook, which answers with a plain list of files (not a collection) when the channel is not in memory, so the link of the picture was not read (
message.attachments.first()is not there) and the confession kept only the nameattachment://suggestion.jpg; at the approval Petto had no file for that name and still wrote the name in the message, and Discord refuses a message that points to a file it was not given (the webhook and then the plain send failed, the member's confession was not published). It showed once pictures in confessions worked again (thecopyPicturefix), and it did not depend on the permissions of the bot. What: the link of the first file is read from a collection or from a plain list (firstFileUrl); when only the name was kept, the card the staff got is asked for the file (reviewPictureUrl) and the picture goes out with the confession; and if the picture cannot be had at all, the confession is posted without it (and the picture is not kept as a name with no file) instead of failing.scripts/check-confessions.jschecks the three cases. - The confirmation of a warn had the plain warning icon, not the one of the warnings. Why:
!warn(and/warn) answered "Se advirtió a ..." withEMOJI.ALERT, the icon that the errors of a command use, while the list of cases (!cases) shows a warn withEMOJI.PETTO_ALERT, so the same warning looked like two different things. What: the confirmation of a warn (buildCaseCard) and the line of a warn that was sent to many members at once (moderation.warn.bulkDone) use the same icon as the case in the list; the other sanctions keep the hammer.scripts/check-moderation-tools.jschecks it. - The bump reminder failed with
Cannot read properties of undefined (reading 'cache')when the bot started. Why: right after a restart Discord still calls some servers "unavailable"; discord.js builds those without their emojis and stickers, and the variable{guild.emoji_count}(and the reminder that uses the variables of a message) readguild.emojis.cache, which did not exist, so the job that sends the due reminders raised a priority error for each of them (TypeError ... resolve (src/utils/embedVariables.js)). What: a guild that is still unavailable waits (the reminder is not sent and not marked as done, so the next look of the job, a minute later, sends it) and{guild.emoji_count}says 0 when the emojis are not loaded, instead of throwing.scripts/check-bump-timing.jsandscripts/check-embed-variables.jscheck both. - A confession with a picture failed with
copyPicture is not a function. Why: confessions copy the picture withcopyPictureofsrc/utils/suggestions.js, but that file did not export it, so the function wasundefinedand the form of every confession that had a picture (a link or a file) failed, in every server (the priority error channel showedTypeError ... takePicture (src/utils/confessions.js)). What:copyPictureis exported again, andscripts/check-confessions.jschecks the export and posts a confession with a picture link (a picture that cannot be copied is only left out). Confessions with text only were not affected.
Added
- Message roles: a role when a member reaches a number of messages (
/messagerole, the dashboard page Roles → Message roles). Why: asked for a role system by the number of messages, like the level rewards but without XP. A rule is a role and a number of messages;totalcounts every message since the first rule of the server (the role stays),periodcounts the last 1 to 365 days andremove_belowtakes the role away when the member falls under. Up to 25 rules per server. Messages are counted only in servers that have a rule on (bots, webhooks and system messages never count), in memory, and written in batches every 20 seconds intomessage_role_totalsandmessage_role_days(days older than a year are deleted every day); the member who wrote gets the role right after, and a look every 30 minutes takes the roles of theperiodrules that fell under. New tablesmessage_roles,message_role_totals,message_role_days. Messages before the first rule are not counted. It is its own slash command, registered in each server (the 100 global slots are nearly used). Written in TypeScript (utils/messageRoles.ts,db/messageRoles.ts,jobs/messageRolesJob.ts,events/messageCreateMessageRoles.ts); checked byscripts/check-message-roles.js. - Permission problems: Petto says exactly what is missing, tells the staff once a day and shows them in the dashboard. Why: "I am missing a permission here" did not say which one, and nobody in the staff knew that a part of Petto was failing.
utils/permissionDiagnosis.tsreads the request of the error of Discord (method, address, body), knows what each request needs (View Channel and Send Messages in a channel, Ban Members in the server, a role under Petto's, a member under Petto's...) and compares it with what Petto really has; nothing is guessed for a request it does not know. The sentence names the permission and where ("Ban Members in this server", "Send Messages in #welcome"). The problem is saved in the new tablepermission_alerts(one row for the same feature, request and permission, with how many times it happened) and told to the staff in the private log channel (kind: permissionAlert,staffOnly: never by DM to the owner, never an alert of the team) at most once every 24 hours, decided in the database. Hooked in commands, prefix commands, tickets, events and rejections nobody caught; a feature that swallows its own errors is not covered. The dashboard asksGET /api/dashboard/guild/:id/permission-alerts(each problem is checked again, so what was fixed is removed) andPOST .../dismiss. Written in TypeScript; checked byscripts/check-permission-diagnosis.js. - An AI helper for moving from another bot, on the Migrate page of the dashboard. Why: the converter only knows the variables of MEE6, Carl-bot and Dyno; tags, commands and autoresponders of another bot need to be understood, not replaced word by word. The helper rewrites a message or command written for another bot, proposes what to set up in Petto from a description, or answers a question about moving. It only proposes: nothing is saved or changed, the person copies what is useful. It uses the same Groq client as
/ask; the prompt carries the variables Petto really has, and the variables the model invents inside a code block are reported back. It needs Manage Server, has a wait between questions and a limit per server and for the whole bot (MIGRATE_AI_*variables), and what is written is never stored or logged. - The welcome, the goodbye and the boost message can have up to 25 messages each, and Petto picks one at random each time (never the same twice in a row). Why: a server that greets many people says the same sentence to all of them; with several, it feels alive (another bot does it, and the maintainer asked for it). The first message is the one
setupsaves; the others are in a new table (member_event_variants, at most 24 for each) and are added in the dashboard (the button "Add another message") or with/greet welcome add-message,remove-messageandmessages(the same forleaveandboost; also!welcome add-message)./greet welcome testshows one picked at random. - Aged roles: give a role after some days in the server, and take another away (
/role aged add|remove|list, also!agedrole). Why: roles like "Veteran" or "Regular" were given by hand. A rule says "after 30 days give@Regularand take@New"; a job looks about every 30 minutes (also at the members who were already in), with at most 200 changes in a server each look, only for roles Petto can give (not managed, below its own role) and with a pause between changes. Up to 25 rules for a server (tableaged_roles); each rule says who gets it (humans, everyone, bots). Servers with more than 100,000 members are skipped. The dashboard has a page for it (Roles › Aged roles). - Moderation rules, much stronger: strikes, heat, more triggers and effects, a join gate with a raid detector, and tools to try rules. Why: the best moderation bots (Wick, YAGPDB) can count what a member does over time and escalate, watch who joins and not only what is written, and let a server try a rule before it punishes anybody. Strikes: a rule can add a violation to a named counter (
violation), another can act when a member has N of them in M minutes (violationstrigger), and a counter can be reset. Heat (like Wick):add_heatmakes a number rise and it falls by itself (the server chooses how fast), and aheattrigger acts above a limit. Timeouts that grow with each time (a multiplier and a maximum). The counters of strikes, the thresholds of the rules ("3 times in 10 minutes") and the heat are now in the database (before: memory), so a restart of the bot does not give anybody a clean record. New triggers: speed of a whole channel, of mentions, attachments and links of a member, the username or nickname (words, a list or a pattern). New conditions: humans or bots (bots are left alone unless the server says otherwise), new or edited messages (an edited message is now looked at again, and an edit does not count for speed), threads, and "has all these roles". New effects: delete the last N messages of the member, slowmode for a while, an alert in a channel, set a nickname, a temporary role, quarantine (a role the server chooses), and lockdown. Test mode for each rule: it only writes in the log what it would do. Join gate (utils/modJoinGate.ts): no avatar, a new account, or a name with a word of a list, each with its own action (alert, timeout, quarantine, kick, ban), and a raid detector (N joins in S seconds: alert, lockdown, or kick or ban whoever joins while it lasts). Try a rule:POST /api/dashboard/guild/:guildId/rules/testsays what a rule (as it is in the form) would do with a sample message, without doing it. Rust: a list of 300 words or more is looked for by a finder written in Rust (Aho-Corasick, built to WebAssembly:native/wordmatch,npm run build:wasm,src/native/wordmatch.wasm), about 15 times faster with 20000 words; it finds the same as the JavaScript way, which is used when the file cannot load (check-wordmatch.jschecks both, and that the committed file is what the source builds). The lists can now have up to 5000 words and 1000 domains. New tablesmod_rule_violations,mod_rule_heatandmod_join_gate; new columns for the rules and their settings. - Moderation rules made in the dashboard: rulesets, rules with triggers, conditions and effects, and lists of words and domains. Why: the automod had a fixed list of filters, and a server could not say "if a new account posts an invite, delete it, and mute after two". A ruleset groups rules that share general conditions (channels, categories, roles, how new the account or the member is); a rule has triggers (words, regular expression, links with a deny or an allow list, invites, mentions, caps, emojis, the same message again, too many messages, attachments, length, zalgo, repeated characters), its own conditions, and effects (delete, reply, DM, warn, timeout, kick, ban, give or take a role). Delete and reply happen on every match; the sanctions wait for the threshold of the rule (for example 3 matches in 10 minutes by the same member). Sanctions go through the same cases, DMs and logs as the other automod. Every match is kept in a log (the rule, the member, the channel and what matched, never the text of the message; the last 500 of each server) and can be sent to a channel. Rules are made only in the dashboard; the bot reads them (
utils/modRules.ts,utils/modRulesEngine.ts,db/modRules.ts, written in TypeScript). - Quick Setup: the dashboard sets up the main modules in seven steps and applies everything at the end. Why: a new server had to visit six pages to get started. The page asks which modules to turn on (moderation log, auto moderation, welcome messages, auto role, tickets, verification) and their options, and nothing changes until the last step. Then
POST /api/dashboard/guild/:guildId/quick-setupmakes the channels and roles that were asked for as new (the moderation log is private) and saves each module with the same stores the commands use, so everything can be changed later from its usual page. A step that fails does not stop the others, and the answer says what was done for each one. It needs Manage Server (a role with access to only one page is not enough). - The dashboard login can add you to the support server, only if you say yes. Why: the first time you sign in, the website asks "Do you want Petto to add you to the support server?"; only a yes asks Discord for the permission to join (
guilds.join), and the bot adds you with it (POST /api/dashboard/support/join, only for the website). The token is used once and never logged or kept, and nobody is added again without being asked. /languageand/supportare slash commands. Why: the prefix commands may stop working one day./languageshows or changes the language Petto speaks on the server (Manage Server), as!languagedid./support(also!support) gives the invitation to the support server.- The Currently log: every change of Petto is posted in one channel when the bot starts, in a color for each kind (security red, new feature yellow, added to a feature green, improvement blue, fix orange, web and docs purple, removed gray, feature removed black), with an explanation and up to three pictures. Why: what changed was spread over the changelog, the wiki and the announcements. The channel is the
currently_logvariable (its ID). The changes are written insrc/data/currentlyLog.json; each is posted once (the bot remembers which ones inbot_settings), five to a card, in English. Without the variable nothing is posted. The first post carries the changes of this version and a link to the blog post that explains it. {partner.top_list_day},{partner.top_list_week}and{partner.top_list_total}write the five best partner managers of the day, the week and all time. Why:{partner.top_total}only gave the first place, so there was no way to show a whole top.- 14 new variables:
{server_age_days},{server_createdate_timestamp},{server_emojicount},{server_stickercount},{server_description},{server_vanity},{server_banner},{server_verification},{server_locale},{server_rules_channel},{user.role_count},{user.top_role_mention},{user.is_owner}and{user.joined_age_days}. Why: welcome and info messages could not show these facts of the server and of the member. /purgeand!purgecan delete in every channel of the server:all_channels(or!purge everywhere 50). Why: a purge only looked at the channel where it was written, so cleaning a raid or a spammer that wrote in many channels meant repeating it in each one. It scans the same amount (1-500) in each text channel where the member and Petto can both read and delete, shows how many messages it would delete in each channel, and waits for a Confirm click before deleting anything (it cannot be undone). Channels without permission are left out and counted; the limit is 100 channels.- A feed can add up to 5 reactions to each notice it posts:
/feed reactions <id> <emojis>. Why: servers wanted to vote or react on what a feed posts (a video, a stream) without every person adding the same emoji by hand, and the command had no way to ask for it. What:/feed reactions 2 👍 🔥 <:pe_ok:123>(also!feed reactions,!feed react) saves up to 5 different emojis in the options of the feed (options.reactions, no new column), usual ones and custom ones of a server Petto is in;clearremoves them. Every notice of the feed gets them, one after the other, right after it is posted and without holding the next notice back;/feed testadds them to the test notice too and says when it could not. A reaction that fails never fails the feed (an emoji Petto cannot use is skipped, no permission or a message that is gone stops the rest), and the command answers when Petto lacks Add Reactions or Read Message History in the channel. The dashboard saves the same list through the same code (cleanOptions). New TypeScript modulesrc/feeds/reactions.ts, new checkscripts/check-feed-reactions.js, and the engine part is inscripts/check-feeds.js(it runs withPETTO_TEST_DATABASE_URL). - The team can block a person from sending DM reports (false or abusive ones). Why: the report button under a message of Petto sends a report to the Petto team, and one person could send false ones again and again (the limit is 3 an hour for each person, so the team still read them all). What: the card of a report in the team channel has a new Block reporter button, with a form that asks why (only the team reads it), and
!blacklist reporter <person> [reason]does the same from a command (withreporter remove <person>,reporter info <person>andreporter list [page]; a mention or an ID, hidden and team only like the rest of!blacklist). A blocked person who presses the report button is told, privately and in their language, that they cannot send reports to the Petto team right now: not why and not by whom; no form opens, a form that was already open is refused when it is sent, nothing is stored and nothing reaches the team. Nobody of the team and no bot can be blocked, a card of a blocked reporter saysReporter blocked: yesand has no button to block again, and every block and unblock leaves a note in the operations channel of the team. It only stops the reports to the Petto team: the reports of the servers to their own staff are not touched. The list of blocked people is read into memory when the bot starts (so the button answers at once) and the table decides every report. The open cards that were sent before this get the new button once, a little after the start. Written in TypeScript (db/dmReportBlocks.ts,utils/reportBlocks.ts), with small changes inutils/dmReports.js,interactions/dmTeam.js,interactions/dmOrigin.jsand the command. Impact: new tabledm_report_blocks(created at start withif not exists, closed to everyone but the bot). Not verified: only tested with Discord and the database replaced (the SQL of the new table was checked for its shape, not run against a real database); the button, the form and the card were not seen in a real server; the Spanish and Portuguese lines of the refusal were written by me and not read by anyone else. - A changelog editor for the team in the dashboard, and the changelog of the website reads from the database. Why: a new version, or a notice such as a security alert or a warning that the bot restarts, needed a change in the code of the website and a deploy of it. What: the new table
site_changelog(version,name,release_date,published,contentas{ en, es, pt }withnoticesanditems, who saved it and when), created at start withif not exists. The website has a page in the dashboard (Staff → Changelog, for the owner and the team) to write a version in Markdown with notices (security, warning, breaking change, information) in the three languages, with a live preview, and to publish it or keep it as a draft;petto.sbs/changelog, each version's page and the RSS feed read the published ones from this table (a version saved here replaces the one of the same number written in the code, and if the table cannot be read the website shows the ones in its code). Impact: one new table, no change for the bot; the notice of every version (Brownie has a security notice) can be written from the dashboard from now on.
Removed
- The AI assistant of the tickets is removed, with everything that came with it, and it will not come back. Why: its answers were not reliable enough and it used more resources than it was worth. Petto no longer says hello with the assistant in a new ticket, no longer answers the person who opened one, and the "Talk to a person" button is gone (the buttons of old assistant messages that are still in open tickets do nothing now; staff answer as always). Its tables (the instructions and knowledge that servers wrote and the monthly count of replies) are deleted from the database when the bot starts.
/askstays: it only shares the Groq client, which moved tosrc/utils/groqChat.js. Its log lines now say[ai]where the client is used without a tag.