Skip to content

Petto v0.7.10

Choose a tag to compare

@github-actions github-actions released this 05 Nov 17:18
Immutable release. Only release title and notes can be modified.
ff91f50

Added

  • /ban and /mute take an optional time; /tempban and /tempmute are not slash commands any more. Why: a ban or a mute that ends was a command of its own, so there were two commands for one action. What: /ban user duration reason and /mute user duration reason (the time is optional: without it the ban is permanent and the mute lasts until it is lifted; with it they are the same temporary ban and mute as before, same cases, DMs, logs and expiry). /tempban and /tempmute are removed from the slash menu. With the prefix nothing is removed: !tempban, !tempmute, !tban, !tmute, !timeout keep working, and !ban @member 7d spam and !mute @member 3d also take the time, or none for a permanent one. The option delete_message_days of /ban moved after the reason so the order is user, time, reason. Not verified: only tested with Discord replaced; the old slash commands stay in Discord's menu until the next deploy of commands. Checks in scripts/check-mod-command.js, scripts/check-slash-commands.js and scripts/check-slash-structure.js.

  • A vote for the bot on top.gg or omniplex.gg gives +10% XP for 12 hours, in every server, and omniplex votes are now received. Why: voting for Petto had no reward other than a role in one server, so there was little reason to vote, and the votes from omniplex.gg (where Petto is listed too) were not received at all. Now a member who voted on either list earns +10% XP from messages and from voice for 12 hours in every server that has the boost on. Both lists share one timer for each member: the boost ends at the latest expiry of their votes (top.gg sends expires_at; an omniplex vote lasts 12 hours), so voting on both never gives +20%, and the weight of a top.gg vote does not change the time. The boost is applied in the one place that awards message and voice XP (applyXpRules), once, with the XP event and rounded together with it: it multiplies on top of the base, role and channel multipliers (the multiplier_cap does not limit it), and it comes before the daily limit daily_xp_cap, which counts the boosted amount; the daily and streak bonus is not boosted. A server can turn it off for free with /levels settings rules setting:vote_boost value:off (!level rules vote_boost off; the new column level_config.vote_boost_enabled, default on, idempotent in schema.sql, listed in rules and status, and written by the dashboard like the other settings); with it off the server gets exactly the old numbers and its rank card shows no boost. A message costs no query: utils/voteBoost.ts keeps a cache by user id (50,000 entries at most, oldest out first; a boost until it ends, "no boost" for 10 minutes; a failed read for 30 seconds), a miss is one query on the new index bot_votes (user_id, voted_at desc) (votes of the last 2 days), and both webhooks put a new vote in the cache at once. The new route POST /webhooks/omniplex (own rate limit of 120 a minute; env OMNIPLEX_WEBHOOK_SECRET; the web server now starts when either webhook secret is set) checks X-Webhook-Signature: sha256=<hex> (HMAC SHA-256 of the raw body, constant-time compare, 401 otherwise), ignores but answers 200 to tests, downvotes, automatic votes and any other event, makes the vote id <voter id>:<created_at> because the payload has none (a delivery sent again is one vote), and then does what the top.gg route does: stores the vote (source: "omniplex"), gives the voter role and posts the thanks, which now name the list and the boost (utils/omniplexVotes.js, utils/voteLists.js). The rank shows the boost as a line of plain text above the card or the embed, never inside the picture: ⭐ +10% XP from your vote, ends <relative time> while the boost lasts; with no boost, and when the server has it on, Vote boost: vote now for +10% XP for 12 hours: and the vote links of both lists, each a masked link with the address between < and > ([top.gg](<url>)) so it shows a short name and Discord shows no preview box; nothing when the server turned the boost off. The new variable {level_vote_boost} (empty without a boost; the dashboard preview shows a sample) is for the cards and embeds of a server, and !votes show also gives the vote links of both lists and says the lists share one timer; all in English, Spanish and Portuguese. New env vars: OMNIPLEX_WEBHOOK_SECRET, and OMNIPLEX_VOTE_URL (optional). Not verified: the shape of the omniplex payload (NEW_VOTE, creator.id, metadata.created_at in seconds, metadata.test, data.downvote, data.auto) and its signature header come from the omniplex documentation and were tested only with payloads built from it, never with a real delivery or the real secret; the default omniplex vote link https://omniplex.gg/bots/<bot id> is a guess (set OMNIPLEX_VOTE_URL to the right page); omniplex's own vote cooldown is unknown, so the thanks no longer say "every 12 hours"; and the cache lives in one process, so a second process would learn of a new vote within 10 minutes. New check: scripts/check-vote-boost.js; docs/REFERENCE.md says exactly this.

  • Role triggers: an action for a member who is given a role or finishes Discord's onboarding while holding it. Why: a server that hands a role to members it does not trust (a "quarantine", "suspicious" or "unverified" role from another bot or the onboarding) had to watch for it by hand. /protect roletrigger add role:<role> action:<warn|mute|jail|kick|ban|remove_role> [duration] [reason] [on], remove role:<role> and list (Administrator only, also !roletrigger) keep up to 25 rules per server, one for each role, in the new table role_triggers (idempotent in schema.sql; the rules sit in a 30-second per-server cache that every write forgets). on is role_added (default: the role was just given), onboarding (the member just finished onboarding and holds the role) or either. The action runs through the same helpers as a manual one, with Petto as the moderator, the case source roletrigger and the reason Role trigger: <role name>: warn is addWarn plus the warn escalation, kick and ban create their case after Discord confirms, ban with a duration is a temporary ban (lifted by the existing expiry job), mute is a timeout when it has a duration (up to 28 days) and the mute role when it has none, jail is jailMember, and remove_role takes the role away (no case: it is not a sanction). Never acted on: bots, Petto, the server owner, members with Administrator or Manage Server, members of a permission group with a level, and members whose top role is not below Petto's. Each grant is handled once in 5 minutes (a repeated event or a role that flaps does nothing more), and a circuit breaker stops the rules of a server for 10 minutes when more than 5 actions fire in 60 seconds, with one warning in the automod log. A member update that gives no role and finishes no onboarding costs no query. The old copy of the member is needed to see a role given or the onboarding flag turning on, so an update for a member that was not cached is ignored. New check: scripts/check-role-triggers.js.

  • Role triggers: the safety stop is configurable, bigger servers get a higher default, and nothing it skips is forgotten. Why: a spam raid is when the rules are needed, and with the fixed limit of 5 actions a minute (then 10 minutes of pause) the sixth raider was already let through and so was everyone after. Now /protect roletrigger limit [amount] [reset] (!roletrigger limit 30) sets how many actions a minute a server allows (1 to 500; with no number it shows the current one, reset:true goes back), saved in the new table role_trigger_settings (the dashboard page of the role triggers writes the same row). With no choice the default grows with the server: 5 below 1,000 members, 10 from 1,000, 20 from 5,000 and 40 from 25,000. Over the limit the rest do not stop: they wait in a line (up to the limit times 10 members, first in, first out) and are handled at the pace of the limit, each one looked at again first (still in the server, still holding the role, the rule still there, not someone who is never touched), so removing the rule or taking the role away stops the line. The warning in the automod log is a card (Components V2, no color) with a short heading and short lines: the limit, how many can wait, what happens if the line fills up, how to stop it and how to raise the limit. Only when the line is full the rules pause for 10 minutes, and then, or when a member waited more than 10 minutes, a second message lists whom Petto did not look at (up to 50 mentions and how many in all), so the staff can check them by hand. The limit and the line are typed code in the new utils/roleTriggerBreaker.ts, compiled over its .js like the other TypeScript files.

  • Role triggers load the members of the servers that have rules, so a role given to a member Petto had not seen is no longer lost. Why: discord.js emits guildMemberUpdate only for a member that is in the cache; for one that is not it caches the member and emits guildMemberAvailable with no old copy, so the first role grant of any member that was in the server before Petto started was never seen (large servers do not send their member list at start). Members who join while Petto is online were already covered. Now utils/roleTriggerWarm.js runs guild.members.fetch() (gateway request-members) for each server that has at least one rule: 30 seconds after the start, one server every 20 seconds, when roletrigger add saves a rule and on guildCreate for a server that already has rules. It does nothing when the cache already holds 95% of memberCount, above 25,000 members in a server (100,000 loaded in total, to protect a 1 GB host), and while the load guard is degraded or critical (tried again after 5 minutes, at most 6 times). In the last two cases roletrigger list and add add one line, in English, Spanish and Portuguese, saying that members Petto does not have in memory yet may be missed. A member that arrives through guildMemberAvailable while holding the role of a rule is only logged in the console (logger.localWarn): no action is applied without the old copy, so a long-time holder is never sanctioned. The sanction behavior is unchanged. New guildIdsWithRules() in db/roleTriggers.js; checks in scripts/check-role-triggers.js. docs/REFERENCE.md says exactly this.

  • The "All links" filter of AutoMod has a list of allowed domains. Why: the filter caught every link, so a server that only wanted to stop random sites could not let youtube.com or its own site through. /automod links allow|remove|list domain:<domain> (Moderate Members, like the rest of /automod) keeps up to 50 domains per server in the new column automod_config.allowed_link_domains (text[], default empty, added by the idempotent migration in schema.sql). A message is let through only when every link in it is one of those domains or a subdomain; evil-youtube.com, youtube.com.evil.com and youtube.com@evil.com are not. The domain is normalized (lowercase, no scheme, www., port or path, IDN as punycode) and anything that is not a valid name is refused. It is checked in JavaScript with the cached config (no extra query per message), only after the filter already matched, and it does not change the rule synced to Discord's own AutoMod or the known-malicious link guard. New check: scripts/check-link-domains.js.

  • The public stats page gets a daily history of servers and members, not only of messages, reactions and voice time. Why: the chart and the day-by-day table of the website had nothing to show for servers and members, because no table keeps how many servers Petto was in, or how many members it had, on a past day. The job that rewrites global_stats main every minute now also saves the row history (at most every 10 minutes, in the same tick, so the load guard pauses it with the rest of the job, and a failure of it never leaves main unsaved): { days: [{ day, servers, members, messages, reactions, voiceSeconds, estimated? }], updatedAt }, one entry for each day in GMT-5, oldest first, up to 120, the last one being today in progress. Messages, reactions and voice time are added up by day from activity_stats in one read-only query over the same servers as totals, and today's entry is exactly totals.today. Servers and members are kept inside the row itself (no schema change): each run sets today's to the live ones, the earlier days stay as they were written, and a new day starts by itself when the day changes in GMT-5. The days before the first saved one are rebuilt once, up to 90 days back, and marked estimated: true: servers from the date each server's row was created and, for a server Petto left that is not deleted yet, the day it left; members from today's count of each server minus the joins less the leaves of member_flow of the days after. It is an estimate (servers that were deleted after they left are unknown, so older days are a lower bound, and member_flow only counts since each server's statistics started), a day that was saved is never replaced by an estimate, and where nothing is known the servers and members of a day are null, never invented. New check: scripts/check-global-stats-history.js.

  • The bot protects itself under load: limits for the prefix commands, a circuit breaker, a queue to Discord with two lanes, a watchdog, and a private !perf. Why: a plain message send took 13 seconds, and a purge 30, because every request to Discord (answers to commands, logs, timers, stickies) waited in one line paced at 8 a second, and when more than 8 arrived in a second the waiting ones were counted again each second by the Redis count, so a request could wait five seconds for nothing. What is new, all on by default and tunable with environment variables (PETTO_*, listed in docs/REFERENCE.md, "Load protection"):

    • Requests to Discord (utils/restGate.js, utils/sharedRestLimit.js): two lanes. The answers to a command, a button or a menu (and interaction callbacks) never wait for the background work; the background work is paced at PETTO_REST_RPS (8), no more than PETTO_REST_MAX_QUEUE (400) wait, no more than PETTO_REST_MAX_IN_FLIGHT (40) are out at once, and one that waited PETTO_REST_MAX_WAIT_SECONDS (30) fails instead of sitting in the line. The host cap of 300 requests in 30 seconds still holds. A request that Discord would hold for more than 15 seconds (a channel renamed more than twice in ten minutes) fails at once. A direct message, a log entry of a sanction, the counters renames and the bot's own member of the snapshots now have a deadline and leave the queue when it is up.
    • Prefix commands (utils/rateLimits.js): a bucket for each person (5, then one more every 2 seconds), a bucket for each server (20, then 2 a second), and at most 8 commands running at once (50 waiting up to 10 seconds, 2 places kept for staff; slash commands share the cap). The owner and PETTO_DEVELOPER_IDS are never limited; members with Manage Messages, Moderate Members, Ban Members or Administrator get three times the limits. A command that is dropped gets one small reaction, at most once every 30 seconds for the person.
    • Circuit breaker (utils/loadGuard.js): normal, degraded and critical, from the lag of the event loop, the wait and the depth of the queue to Discord and memory; it goes up at once and down after 90 seconds of calm. Degraded pauses feeds, snapshots, counters, the safety-net jobs and the logs of low value and halves the prefix limits; critical keeps only interactions, staff commands, moderation, tickets and verification. The team gets one alert in the priority channel for each change.
    • Watchdog (utils/watchdog.js) and process guards (utils/processGuards.js): the bot exits cleanly (the host starts it again) after 3 minutes in critical, a loop blocked for 60 seconds (a thread apart watches it) or memory over 90% of BOT_MEMORY_LIMIT_MB (1024) once the caches were dropped, never more than 3 times an hour (then it stays critical and says so). An unhandled rejection or exception that is only a failed request (Discord, network, database, timeout, abort) no longer stops anything; the events of the connection to Discord are handled one by one and only invalidated stops the process.
    • Measurements, always on (utils/perf.js): a record for every command (time to the first answer, database, REST and Redis), the latency of the last 200 queries and requests, the event loop (p50, p99, max), CPU and memory every 10 seconds for an hour, every gateway listener (calls, time blocking the loop, time to finish) and the events a second by type, every interval job, the rate limits, the invalid requests, and the difference between the clock of the host and Discord. A command over 2 seconds, a request over 2 seconds and a listener that blocks more than 150 ms are warned about (at most once a minute each).
    • !perf (private, owner and developers, hidden): the summary, !perf rest|slow|jobs|listeners|limits|probe, and !perf level normal|degraded|critical|auto (owner only, to test). !ping now says what it measures (the time to send one message, the heartbeat of the gateway and a REST probe of the network) with one clock.
    • Database: every query is timed, background queries use at most max - 3 connections so a command always finds one, the pool keeps 2 connections, keeps idle ones for 5 minutes and keeps the sockets alive, and the json columns of all tables are read in one query instead of one for each table.
    • Commands: the level, the roles, the restrictions and the rules are asked at the same time (and the levels and the roles chosen with !moderation are kept for 15 seconds), /mod purge deletes the command message and acknowledges together.
  • A duration right after the member makes a mute or a ban temporary: !mute @member 3d spam, !ban @member 7d spam. Until now !mute @member 3d muted with no end and took 3d as the reason, and a temporary one needed !mute temp or !ban temp. Now a word with a unit (3d, 12h, 1h30m, 2w, also in Spanish and Portuguese: 2semanas) in the place of the duration is the duration: it runs the temporary mute (a timeout, up to 28 days) or the temporary ban, with the same cases, messages and logs. A plain number is not a time (!ban @member 7 spam still deletes 7 days of messages), a word that is not a time stays the start of the reason, and !mute temp, !ban temp, !tempmute and !tempban work as before. The slash commands got the same as an optional duration option of /mod mute and /mod ban (/mod tempmute and /mod tempban are not in the / menu any more: see Changed). A hard ban is never temporary.

  • The /levels rank embed shows its progress bar as a small flat picture instead of emoji blocks, with a theme for Halloween and one for Christmas. The same plain bar Petto always had (a slim rounded pill, a fill on a track, no gloss) is drawn as a 640x56 PNG of 2 to 12 KB, attached to the embed as rank-bar.png and shown under the fields. Three themes: normal (blue-grey on white), Halloween (orange on deep purple, with a flat cobweb, spider, bats, pumpkins and ghost around it) and Christmas (candy-cane red on a light track, with a string of colored lights waving along it); voice keeps its own accent in each one. The theme follows the date when the reply is made (Halloween all of October, Christmas November 1 to January 10, UTC) and RANK_BAR_THEME (auto, normal, halloween, christmas) overrides it. A bar is drawn the first time it is asked for and kept in an LRU by theme, percentage and color, so after that there is no drawing at all (RANK_BAR_CACHE_ENTRIES, default 512; RANK_BAR_FORMAT, png or webp). Nothing else in the embed changes (same author, fields, footer and colors), except that the Progress field, which used to hold the emoji blocks, now says how much is missing (N XP to level 84, in the three languages). If the picture cannot be drawn the embed carries a thin bar of plain characters, so a rank is always answered. The card style is untouched. The leaderboard is redesigned too (see the next entry). scripts/bench-cards.js times the pictures. New check: scripts/check-rank-images.js.

  • The leaderboard (/levels leaderboard, !top, !leaderboard, !lb) has a podium picture, two lines for each member and your own position with a bar. On the first page the top three are one small picture (avatars in medal rings, name, level and XP); the other places are one embed field each, one under another (04 · Luna · luna_99, the display name and next to it the username when it is another one, over the level and XP in small gray text, Lv. 70 · 1.5M XP, safe for long, emoji, Markdown and right-to-left names), and at the bottom a You field shows your place with the same progress bar picture as /levels rank (a week or a month shows the XP earned instead of a level). Paging works as before: the same buttons, only the person who asked can press them, and a page without a podium empties the picture of the page before. Avatars and finished pictures are cached (BOARD_IMAGE_CACHE_TTL_MS) and at most a few pictures are drawn at once. When a picture cannot be had, the embed still answers with the plain list. New check: scripts/check-leaderboard-view.js.

  • /game ship and !ship have a love-themed card and a richer message. The card is now drawn in code, with no background picture: a soft gradient that follows the score (gray-blue with a broken heart for a very low score, pinks in the middle, red and gold with sparkles for soulmates), hearts and sparkles of different sizes and opacities, both avatars in circles with a ring of the color of the step, a big heart with the percentage, the name of the pair, and a row of ten hearts that fills with the score. It is bigger and bolder so it reads on a phone, stays light (a PNG under 250 KB), and copes with long names, names made of emoji and avatars that fail to load (a figure in the colors of the card takes their place). The message above it has three lines: the name of the pair (the first half of the first display name with the second half of the second one, always the same for the same two members, without emoji or symbols, and a fallback name when a name is too short or has no letters), how compatible they are, and the title and a short sentence of one of eight steps (two sentences for each, in English, Spanish and Brazilian Portuguese). The score is unchanged (the same pair still gets the same result), nobody is pinged, and the text alone is still sent when the picture cannot be drawn. The old background picture (fondoship.jpg) is removed. New check: scripts/check-ship.js.

  • Roles: /role join, /role sticky, a job for every mass role command, preview, pause, and a much better dashboard Roles page. /role all, humans, bulk-by-role (it was has), bots and bots-remove now run as the same persistent job the dashboard uses (one at a time per server): it is read in pages of 1000 members so a huge server is never loaded whole, it goes on from where it was if Petto restarts (before, a restart left a job running for ever), it reports in a card with the checked, changed, already fine and failed counts and the time left, and it stops after 15 refusals in a row when Petto lost the permission. New options: preview (counts who would change and touches nobody), without (members who do not have the filter role), joined_after / joined_before (a day like 2025-03-01 or a time back like 30d), min_roles / max_roles (0 is members with no roles) and reason (shown in the audit log). /role job [status|pause|resume|cancel] (also !role job, !role status) shows the running or last job and its history; /role cancel still works and now also cancels a job started from the dashboard. A word of the command works as the option of that name (!role all @Role remove preview). /role join add|remove|list|clear|apply and /role sticky enable|disable|status are the old !joinrole and !stickyroles as groups of /role (they leave /greet; the old prefix words, aliases and short words keep working). !joinrole add <role> ... after_rules gives the role when the member accepts the rules (Membership Screening), !joinrole list warns about a role that was deleted, is managed or is above Petto, and !joinrole apply <role> [preview] gives a join role to the members who are already in the server, with the target it was set for. Schema: only added columns (bulk_role_jobs, join_roles.after_rules).

  • Partners, uploads, reviews and requests: milestone rewards, nickname format, review rules, a fuller member card and request reminders, all free. !partnerconfig reward add <count> <role> [message] / reward remove <count> / reward list, and the same with !uploadconfig reward: when a member's total reaches the number, Petto gives the role (Manage Roles, the role below its own highest role, checked when it is added and when it is given) and posts the optional message with the usual variables plus {milestone.count}, {milestone.role} and {milestone.role_name}. Each milestone is given once per member (the award is claimed with a primary key before anything is given, so two partnerships or uploads at the same moment cannot repeat it), a deleted role is skipped and reported to the staff, and a removal never takes a role back. !partnerconfig nickname <format|off> ({name}, {count}, off by default) renames a Partner Manager after each partnership when Petto has Manage Nicknames and can manage the member. !profileconfig rules sets the minimum age of the reviewer's account, the minimum time in the server, a cooldown between reviews and the minimum and maximum length of a comment (all off by default), and the staff can remove somebody else's review with !review remove <user> <reviewer>. !profile is one card with, for the modules the server uses, partnerships (total, this week, today, rank, last), uploads (the same), the rating (average, count, last review) and requests, in English, Spanish and Brazilian Portuguese. !requestconfig notify <hours|off> pings the staff once for a request nobody claimed, and !requestconfig unclaim <hours|off> (the old timeout, no longer Premium) gives a request back when its claim is not finished in time; both are off by default and run in the existing 10-minute job. New tables milestone_rewards and milestone_awards and a few columns with defaults (schema.sql is idempotent); see "Partners, uploads, reviews, profiles and requests" in docs/REFERENCE.md.

Changed

  • Confessions look softer, and the staff sees who wrote them. Why: a confession had the green of every message and nothing at its side, and the review card and the log of the staff never said who wrote it, so a confession that broke a rule (an 18+ one, say) left the staff searching for whom to sanction. A confession is now a soft pastel yellow (#ffee99) with a face asking for silence (shh) at its right side; a server that still had the old green default saved shows the new one, and one that chose its own color keeps it. The review card shows who wrote the confession and the confessions log has a line for every confession and every anonymous reply that is posted, with its author (members still see nothing of it, and nothing is shown when the server keeps no authors).

  • Backups are open for every member again. Why: they were paused for everybody but the owner and the developers (BACKUPS_MAINTENANCE had to be off to bring them back). !backup, its panel, the dashboard page and the scheduled backups now work for everyone by default, with the saved backups and the schedules as they were. The pause is still there for when it is needed: set BACKUPS_MAINTENANCE=on. The dashboard reads the same switch.

  • The daily history of the public stats page shows the activity counted before the outage of Discord, so the chart adds up to the cards. Why: the all-time totals already start from the baseline of what was counted before the outage (globalStatsBaseline: 1,000,000 messages, 48,000 reactions and 100,000 hours of voice, PETTO_STATS_BASELINE_*), but the history of messages, reactions and voice time was only what activity_stats kept, so the sum of the chart did not match the cards. That baseline is now spread as a flat average, in whole numbers that add up exactly to it (the first days get the remainder), over the 134 days from 2026-04-03, the first day of the records, to 2026-08-14 (activityBaseline in src/data/membersHistorySeed.json, which says it is approximate), on top of what was really counted on each of those days. Those days carry the new optional flag estimatedActivity: true (never written as false, independent of estimated for the members and estimatedServers). The outage week (2026-08-15 to 2026-08-25) and every later day, and today, stay exactly as counted, with no marker. The activity of every day is read again on every run, so the row that already exists is corrected on the next run without deleting it; a metric whose baseline is 0 gets nothing, and with all of them at 0 nothing is flagged. The sum of the messages of the history is what was counted plus the baseline.

  • The servers of the days before the bot stored them come from the public count of discord.watch, a daily number, with the gaps drawn as straight lines. Why: the chart of servers had no history, and the estimate from the rows of the servers is only a lower bound, while discord.watch, a public tracker, measures the real number of servers of the bot every day. src/data/serversHistorySeed.json has its daily counts from 2026-07-28 (kept exactly as received, with null where the tracker has no number: the file says where they come from). The first time the history row is written (nothing stored yet, the same condition as for the records of members), a day with a number takes that number, and a day with null takes a straight line between the nearest known days on both sides and gets the new optional flag estimatedServers: true (never written as false). Before 2026-07-28 the servers stay null, today is always the live count of the bot (it can differ a little from the tracker: 182 and 178 on the day it was fetched), and a stored day is never replaced. The old estimated flag now means the members only; a day can have estimated members and measured servers, or the other way round. The rebuild from the rows of the servers is still used where the tracker has no day.

  • An edited message that was not cached is no longer asked for. Why: !perf rest showed that the two listeners of messageUpdate (the edit log and the snipe of edits) made about 58 GET /channels/:id/messages/:id each in 10 minutes, one for every edit (and every embed that Discord adds to a link), until Discord limited that route (a wait of 4.5 seconds for each request) and a request waited 24 seconds, which put the bot in critical. An edit of a message that was not cached has no "before" to show (the fetch gives the message as it is now), so now it is skipped.

  • The last days of the members history are exact counts. The team kept exact counts for the last days (55,700 on 2026-11-01 and 56,430 after it, the second date assumed): the line of the members passes through them and, from the first of them to today, those days are not marked as estimates (the page draws them solid).

  • The history of members of the public stats page starts from the team's own records instead of from today's number, and keeps 400 days. Why: the bot only began to count its members recently, so the chart of members was empty or flat before that, although the team knows how many members Petto had on many dates in 2026: the dates before the bot counted its members come from the team's own records, src/data/membersHistorySeed.json (the file says so). The records have two parts: a baseline, the members that stayed (dated anchors with a straight line for each day between them, two anchors on consecutive days for a jump such as a server of 13,000 or of 30,000 members joining, and a straight line from the last anchor to today's live total), and spikes, the totals of the days when big communities added the bot and removed it again (the bot was down, so they were not counted day by day), which replace the baseline on the recorded day and the 2 days after it, and then the baseline resumes. The baseline is a plain straight line between its anchors: no noise is added to look like measured data. The first time the history row is written (nothing stored yet), the days from the first anchor (2026-04-03) to yesterday are filled from them; nothing is shown before. The days between the recorded dates are marked estimated: true; the days of the spikes (a date and a total the team recorded) and the last days with exact counts are not, so the page draws only the stretches between known dates dashed; servers stay null there unless the rebuild from guilds and member_flow can estimate them. Two things are assumed because no date or length was given: the bottom of the baseline (40,000 on 2026-09-15) and that every spike lasted 3 days (the owner said 3 days at most). Today is always the live value of the bot, a day the bot stored itself is never replaced, the records are only used for the days before the first stored snapshot, and what was written is frozen on the next runs. The row now keeps up to 400 days instead of 120 (HISTORY_DAYS). To correct the records, edit the file and delete the row history once.

  • The totals of the public statistics page start from what was counted before the outage. Why: a day of deploy with Discord down made the counters lose part of their history (the page said 487,000 messages, 50,000 reactions and about 11,000 hours of voice, and the figures the owner kept apart are 1,487,000, 98,000 and 111,000). The global_stats snapshot now adds a baseline to the totals of all time only: 1,000,000 messages, 48,000 reactions and 100,000 hours of voice (PETTO_STATS_BASELINE_MESSAGES, PETTO_STATS_BASELINE_REACTIONS and PETTO_STATS_BASELINE_VOICE_HOURS; set one to 0 to take it out). Today, the week, the daily history and the rankings are real counts and do not get it.

  • The public ranking of servers has 10 places and shows their members. Why: the statistics page of the website shows a top 10 with the members of each server; the snapshot of the bot (global_stats) kept only 5 and no member count. Each entry of ranking now has members too (the server still has to be public: the ones that hide themselves are left out as before).

  • The members chart of !stats growth shows every day: an axis zoomed to the real range, and the joins and leaves of each day as bars. Why: on a server of about 600 members that gained 35 in 30 days, the line was flat, because the axis started at 0 and the daily changes (2 to 9 members) are tiny against 600; nobody could see the ups and downs, only a straight line. Now the members line is drawn on an axis that goes from the lowest to the highest value of the period with some room, at round steps (a span of at least 6 members, so a change of one member is not a cliff; it never goes below 0), one point for each day, each segment green when the day went up, red when it went down and grey when it did not move, with the first and the last value written on the line and the change of the period (+35) next to the title. Under it, a bar for each day: joins up in green, leaves down in red, around a zero line, with the day with the most joins and the day with the most leaves marked, and with the number of every day on it up to 14 days (30, 90 and 180 days have thinner bars and fewer labels along the bottom). A server that has no count of members keeps the fallback, the running net change from zero, now zoomed and with signed labels. The other cards of !stats keep their axis from zero (their charts are volumes, not flat), and the card is the same size with the same colors. The numbers behind it (utils/growthChart.js) are plain functions. New texts in English, Spanish and Brazilian Portuguese (info.statsCard.growth.*), and the description of /stats growth says day by day. New check: scripts/check-stats-growth-chart.js.

  • No more "Petto left a server: undefined" after a restart. Why: when the bot started, Discord sometimes sent the event "server removed" for a server that was not loaded yet (a bare object with an id and no name), or for one that was only unavailable, and Petto told the team that it had left, with the name undefined, even though it never left. Now an unavailable server is ignored, a server without its data is asked to Discord first (client.guilds.fetch), and the departure is logged and written down (the data of a server that left is deleted after some days) only when Discord says Petto is really out (Unknown Guild or Missing Access). If the question fails for another reason nothing is told. A loaded server that is removed works as before.

  • A steadier memory: a smaller cache of messages, a heap limit and a calmer load guard. Why: the bot was reaching 440 MB of 512, was given 1 GB, and then got slower (a ping of 20 seconds): a bigger heap means a longer pause of the garbage collector each time it cleans, and every pause stops the event loop. Now: only 100 messages are kept for each channel (200 before) and the ones older than an hour are swept every 10 minutes; npm start limits the heap of Node to 768 MB, so it cleans before the host would stop the process; discloud.config says RAM=1024. The load guard goes to degraded from an event loop p99 of 800 ms (it was 400, and a 404 ms moment was an alert), and the changes between normal and degraded stay in the console and in !perf (only critical writes to a channel). !perf shows the heap, the buffers, the pauses of the garbage collector of the last hour (runs, time stopped, longest) and what each cache holds (members, users, presences, channels, roles, messages), to see what takes the memory and the time.

  • The measurements of !perf no longer write to the log channels. Why: "Slow command", "Slow Discord request", "Discord warns about invalid requests", the event loop and the blocked listeners were warnings that went to the general log and to the error channel, and on a loaded bot they were a message every few seconds, each one a request to Discord that made the load worse. Now they stay in the console of the host and in !perf (!perf slow, !perf rest, !perf limits). The only one that still reaches the team is the invalid requests (401, 403, 429) when they get near the block of the address: 2,000 in 10 minutes (the block is at 10,000), at most once every 30 minutes.

  • The temporary variants are out of the / menu: a mute or a ban becomes temporary by giving a duration. /mod tempmute, /mod tempban, /ban temp and /modtools mute temp are no longer registered with Discord (the temp leaf of ban and mute and the two subcommands of /mod are prefixOnlySubcommands). The same action is /mod mute duration:3d, /mod ban duration:7d, /ban user duration:7d and /modtools mute user duration:3d (the option already existed in all four). The prefix words are untouched: !mute temp, !ban temp, !tempmute, !tempban, !mod tempmute, !tmute, !tban and !timeout work as before, with the same cases, messages and logs. The short alias !mmt (it stood for /modtools mute temp) is gone with its leaf; !mm and the other short words are unchanged. /mod has 23 subcommands now (there were 25), and /role temp and /role temp-list (temporary roles, not sanctions) stay.

  • The slash commands are grouped and named with whole words, and every public prefix command has a slash entry. /level, /rank and /top are now one command, /levels: /levels rank (your level, or someone else's), /levels leaderboard (the ranking of the server) and the settings of the system in the groups settings, voice, reward, multiplier, event and manage (/levels voice xp, /levels settings starting-bonus, /levels manage reset). /act is /action. The loose commands are folded into groups: /botinfo and /ping are /bot info and /bot ping, /poll is /community poll, /suggest is /community suggestion submit. The prefixes of the server have their own command, /prefix view|add|remove|set|reset (they were a group of /config; the personal prefix stays in /me prefix). The names that were abbreviations or unclear now say what they do: /auto is /automation, /contrib is /contributions, /special is /specialchannels (with the groups imageonly and linkonly), /greet poj is /greet pingonjoin, /config has the groups moderationroles, commandroles, disabledcommands and statistics, /staff has image-mute, image-unmute, reaction-mute, reaction-unmute and raid-clean, /role members and /role bulk-by-role, /server role-members, /me reputation, /game rockpaperscissors, the booster role settings moved to /boosterrole settings, and the options of curve are cubic, square and linear. The lookups of games (minecraft, roblox, steam, chess, pokemon, modrinth) moved from /game to /search, and /search now has a group for each service with all its lookups (/search github repo, /search youtube channel). Nothing is lost with the prefix: !level, !levels, !rank, !top, !leaderboard, !act, !auto, !contrib, !special, !botinfo, !ping, !poll, !suggest and every other old word, alias and short alias still work, !config prefix and !game minecraft still reach the old commands, and the rules a server saved with !disablecommand, !restrictcommand and !permissions under an old name still apply. 62 slash commands are registered now (there were 64), so 38 of the 100 that Discord allows are free.

  • /quests is public: a slash command and a command of !help. The alerts for Discord Quests (/quests enable, disable, role, style, rewards, tasks, card, color, expiring, type, thread, method, list, resend, test and status) were a hidden prefix command while the Quest API was in test; the API allows every server now, so !quests is listed in !help, /quests is in the / menu with the same code and the same checks (the setup asks for Manage Server, list is for anybody), and it has its short aliases and its !questsconfig card. QUESTS_PUBLIC=false still closes it for a time: then members are told it is in testing, as before.

  • Slash commands that were only in the prefix: /modtools and /social. /modtools holds the cases, notes, jail, the list of mutes, forced nicknames, threads, the deleted message viewer and the lockdown (/modtools case view, /modtools lockdown start), and /social the birthdays and the reputation with their settings (/social birthday upcoming, /social reputation leaderboard). They run the same code as !case, !note, !jail, !mute, !nickname, !thread, !snipe, !lockdown, !birthday and !rep, with the same permission checks. /search also covers the rest of the lookups that only had the prefix. A new check (scripts/check-slash-structure.js) keeps the structure: no loose command, no abbreviation in a name, the old words still resolve and the limits of Discord hold. Left out on purpose: !timeout (an old word of !tempmute).

  • The /levels rank embed no longer uses the nine custom emojis for its bar. The Progress field of the embed style says how much is missing for the next level (its picture is the bar, see above), and when no picture can be shown it holds a thin bar of plain characters. The text bar of utils/levelProgressBar.js is still what the {level_bar} variable and the identity sync card use.

Fixed

  • /server info <id> (and !serverinfo <id>) works for the team of Petto on any server it is in, and tells apart a wrong ID from the rest. Why: with an ID it only answered when the person was a member of that server and said "doesn't exist, Petto is not in it, or you are not a member" otherwise, so the owner could not look at a server of the bot that they are not in, and an ID pasted with brackets or quotes, or a name instead of an ID, failed the same way. Now the owner and the developers can ask about any server Petto is in, an ID is cleaned of spaces, quotes, < > and a trailing comma, something that is not an ID says how to copy one, and a failure of Discord when checking the membership says to try again instead of "not a member". Everybody else still needs to be a member of that server.

  • Omniplex votes: every delivery leaves a line in the log, and the three ways to sign a webhook work. Why: votes cast on omniplex.gg were not counted and nobody was thanked, and nothing in the log said why (a refused or ignored delivery was silent). Now each delivery says whether it was stored, already stored, not counted (and why) or refused (wrong secret, missing signature, unsupported method), the start says whether the route exists and whether a thanks channel is set, and besides HMAC the webhook also accepts the simple-auth and splashtail methods that Omniplex offers.

  • A reaction, or a deleted message, no longer sends requests to Discord for nothing. Up to five handlers (reaction roles, giveaways, the activity stats, the custom commands that watch reactions and, on removal, the reaction snipe, with up to three requests of its own) completed every reaction of every server from Discord with a GET /channels/:id/messages/:id, and every deleted message that was not cached was asked for although it was gone (a 404 each time). A busy reaction hit the rate limit of that route and held every other request of the bot for seconds (the retry after 4.4s and the 20 second waits of the log). Now the handlers use what the event brings (the ids and the emoji, which is all they need), the custom command asks its database by the id of the message first and completes the message only when it is watched, the reaction snipe leaves out the text of a message that is not cached, and a deleted message is not asked for.

  • Going to the degraded level no longer pings the team. The load guard sent a priority error (a ping) for every change of level that goes up, so the first step, normal to degraded, where the bot protects itself and keeps working, woke the team for nothing. Now only going to critical is a priority error; degraded and coming back down are warnings in the ordinary log.

  • A new avatar or username of anyone no longer sends up to one request to Discord for each server. The log of avatar and username changes asked Discord for the member in every server where it was not in the cache (one GET /guilds/:id/members/:id for each of the bot's servers, nearly all answered 404) for a single change, and users change them all the time: it filled the queue of requests and slowed commands down. Now only the servers where the member is already known are logged and no server is asked about; the log is the same where the member is known.

  • The bump reminder goes out at the minute the cooldown ends, not up to a minute later. The job that sends it only looked at the table once a minute, so a reminder could be almost a minute late whatever the ping. Now every server with a bump waiting has an exact timer (armed when the bump is seen and, for all of them, when the bot starts); the timer reads the row again when it fires (a newer bump, a reset or an unset channel win) and a timer and the job never send the same reminder twice. The job stays as the safety net: it also runs once when the bot starts, so what was due while the bot was off goes out at once.

  • A server that loses its Server Tag no longer keeps the roles it gave for showing it. When a server loses the improvement (the boosts) that allows a Server Tag, Discord stops showing it but sends no event for each member, so the roles given by the Server Tag rules stayed for good. While the server does not have the GUILD_TAGS feature, its rules about its own tag (is_guild_id with its id) match nobody, so the roles Petto itself gave through them are taken away (a role given by hand is never touched, as always), and they come back when the improvement returns. The members are checked again when the server's features change and, as a fallback, 90 seconds after the bot starts and every 6 hours for the servers that cannot have the tag and have such a rule. Rules about other servers' tags and the rest of the identity rules are as they were. When the features of a server are not known nothing is taken away.

  • The direct message of a join is sent a few seconds after the join and tried again when Discord refuses it, and no longer pings the team. Discord needs a moment to count a new member as someone who shares a server with Petto and, before that, refuses the message with code 50278 ("no mutual guilds"); it was sent in the same instant and, when refused, the team got a priority error. Now it is sent after JOIN_DM_DELAY_MS (5 seconds by default, 0 to 60000), and when Discord still answers 50278 it is tried again after 30 seconds, 2 minutes and 10 minutes while the member is in the server and the message is still turned on. The 50278 is known to the error triage (normal, not a priority) and a refused DM of a join (50278 or closed DMs) is no longer logged as an error. The message is not held with the welcome (welcome_wait), because it often carries the rules.

  • YouTube: a new video waits for a picture that loads and uses the largest one. The notice of a new video took the thumbnail of the channel feed as it came, and a video that is only minutes old can have no thumbnail made yet (YouTube answers a gray stand-in or nothing), so Discord, which asks once, kept a gray box for good. The notice now looks for the best picture that really loads (largest first; a stand-in of a few hundred bytes does not count). A video younger than 20 minutes with none yet is held, not marked as seen, so the next look posts it with its picture; an older one goes out with the picture of its feed. Shorts are unchanged.

  • Roles: a temporary role no longer comes back to bite, and a mass role notice no longer pings the role. /role remove, /role add, /role group give|take, a mass job and taking the role away by hand forget the temporary row of that role, so the expiry job cannot take away a role that was later given for good; /role temp says when the member already had the role. The notice a dashboard job posts in its channel mentions the role without pinging it. A join role that Discord refuses is logged with the real error, so the error triage tells a role above Petto (the server's to fix) from a real failure.

  • Partners and uploads: blacklisted ads are taken down and a few counting mistakes are gone. An ad in a partner channel with the invite of a blacklisted server is now deleted (when Petto has Manage Messages) and the poster gets a short notice that disappears by itself; before, it was only answered, and deleted only if refused posts were not kept. Two invites of the same server in one message count as one partnership. Uploads in a thread of an upload channel, or in a post of an upload forum, now count, and two files from the same member at the same moment give one welcome, not two. A claimed request that was finished at the moment the time limit ran out is no longer reopened.

  • The list of /help command: says what each command does. Discord's autocomplete list has no description line, so each choice is now written as ticket category add · Adds a ticket category (in your language, cut to the 100 characters Discord takes); the value that is looked up is still the command path.

  • Sticky messages come back to the bottom in about half a second instead of after a long wait. Since the "one repost per burst" change they waited a fixed 3 seconds after the last message, and then did a fetch, a delete, a database read, a send and a database write one after the other. Now the sticky is posted 350 ms after the last message (STICKY_QUIET_MS), a burst can delay it at most 2 seconds from its first message (STICKY_MAX_WAIT_MS), so a long conversation still gets it, and the new sticky is sent first and the old one deleted after, together with the database write, so a channel is never left without its sticky. It still never ends up above a newer message and never doubles: there is one job at a time for each channel, nothing is fetched to know whether the sticky is last (the ids of the messages that arrived are compared with the id of the sticky just posted), and a message that arrives while the sticky is being sent makes one follow-up pass that puts it below. The channel's sticky settings stay in the cache after a repost instead of being read from the database again on the next message, a 429 waits what Discord asks and is retried twice, and a deleted channel, a missing permission or an old sticky that is already gone no longer log errors. scripts/check-sticky.js now runs the flow with a fake clock (one message, a burst of 20 in 3 seconds, a message that arrives while sending, errors, two channels, rate limits). See "AFK / autoresponder / sticky messages" in docs/REFERENCE.md.

  • The actions that only the owner or the Petto team can use are no longer slash commands: nobody sees them in the / menu. /bot premium grant, assign, unassign and revoke (the owner-only Premium actions, which refused at runtime but were listed for everybody), /channel create ("team only for now"), /automod control and /guilddebug (info, send, dm-owner; it was registered in one private server) are removed from the registered commands; the registered chat commands stay 67 and the private-server registration is gone. They are hidden, prefix-only team tools with the same behavior and the same silent rule as the other team tools (for anybody outside the team they are not commands: no reply, no typing, no "unknown command", not in !help, the autocomplete, the suggestions or the catalogs): !premiumadmin grant|assign|unassign|revoke (owner only, a developer gets no answer; the old !premium grant ... words keep working), !channel create (still answers non-team with its team-only message), !guilddebug info|send|dm-owner (same data as before, still only in the diagnostics server; the channel of send is now --channel <id> at the end) and the hidden !am <token>. /premium and /bot premium keep only what members need: status. Run node deploy-commands.js after deploying so Discord forgets the removed commands. A new check, scripts/check-team-not-slash.js, fails if any slash command, group or subcommand is a team-only action (explicit list), if a registered command carries a team flag, or if the source of a registered command (and of the ones an umbrella wraps) has a team gate that is not allowed with a written reason; it also proves it reports the old state.

  • !team is easier to use. The tools are grouped by area (servers, bot status, Premium, moderation tools), paged with the usual buttons (only you can press them) when they do not fit one card, and each one says whether petto <word> works too. !team <command> shows one tool in detail (usage, examples, what it answers, what to be careful with, who can use it, its old words) and the card says that none of them is a slash command. It is still generated from the metadata of the commands, so a new tool appears by itself, and it still answers only the owner and the developers.