Skip to content

Petto v0.7.9

Choose a tag to compare

@github-actions github-actions released this 29 Oct 01:30
Immutable release. Only release title and notes can be modified.
83f1bef

Added

  • Buttons with actions in Components V2 designs. A button of a V2 design (in a row of buttons or as the button of a section) can have the same actions as in an embed code: give, take or toggle a role, or show a saved embed (privately, in the channel or in the DMs). It has a color (blurple, green, grey or red) and keeps what it does in its id, so nothing is stored. A button whose role does not exist, or a design sent where there is no server, leaves it out.

  • Petto Code: forms with every part Discord has. Besides ctext, a form (cmodal) can hold cmenu (a menu of choices, with the ones selected from the start), cusers, croles, cmentions and cchannels (pickers of members, roles, both, or channels of the kinds you say: text, voice, announcement, category, stage, forum, media, thread), cfile (up to 10 files to upload), cradio (radio buttons), cchecks (a group of checkboxes), ccheck (one checkbox) and cdisplay (a text that only informs, with Markdown). Every part has a label and a description, and min, max and required where they make sense. A form holds up to 5 parts and at least one that people fill in. What a form gives back is in .Fields (a text, a list of values or of ids, true or false, or a list of files: .Fields.proof is [{ID Name URL Size Type Description}]), the new .FieldText (the same, ready to print: ids as mentions, lists joined, ✅ or ❌) and the new .Files (every file of the form in one list). The parts are under their label (the new way of Discord, so ctext too).

  • Feeds: pictures are searched in many places, so anime roses gives anime roses. 15m anime roses takes the words, up to four now, and searches Wallhaven (its anime category, safe only) and Safebooru when a word asks for anime (anime, manga, waifu, chibi, ghibli, otaku, vtuber). The rest is searched by meaning, not by the tags of whoever uploaded them: Google Images (GOOGLE_CSE_KEY and GOOGLE_CSE_CX, a Programmable Search Engine with images on), Pixabay (PIXABAY_API_KEY), Pexels (PEXELS_API_KEY) and Unsplash (UNSPLASH_ACCESS_KEY) when the bot has their keys, then Openverse (no key, no adult content) and the public tags of Flickr as before. Everything is asked for safe pictures only, a place that fails or has nothing is skipped, and the notice says where the picture is from. rosas is roses.

  • !send, buttons that do things in embed codes, and an embed code as the message of !welcome, !leave, !boost and !dmonjoin. !send [#channel] <message> sends a message as Petto: text with line breaks, links, role mentions (a role that is not mentionable only pings if you have Mention Everyone), the pictures, videos or files attached to the command (up to 10), an embed code, and it is a reply when the command replies to a message. It needs Manage Messages in that channel. In an embed code, {button: green && Get the role && role:@Members} is a button that gives or takes a role: role: toggles, addrole: and removerole: only do one; {button: blurple && Rules && embed:rules:dm} answers with a saved embed, privately by default (embed:name:ephemeral), in the channel (:public) or in the DMs (:dm); a button can do several things (up to 4 actions), and its color is blurple, green, grey or red. What a button does is kept in its id, so nothing is stored, and a role is only given when it is below the highest role of Petto. Who sends a code with !send needs Manage Roles and a role above the ones in the buttons. The setup commands now read the code whole: !welcome setup #general {embed}$v{description: Hi {user.mention}}$v{button: green && Rules && embed:rules} saves the code as the message (/welcome setup with the message option too) and tells how many embeds and buttons it has and what was not understood. The names other bots use for boosts and levels work too ({boost.count}, {boost.level}, {boost.required}, {level.new_rank}, {level.user_xp}, {guild.members}...).

  • Music: a longer bar, and the time of each change between songs told in parts. The progress bar uses the five pieces of the music set (filled cells up to a pill with a knob, then dark cells to a rounded end), has twelve pieces (it had five) and is alone in its own text of the card, so Discord shows its emojis big like the bar of Flamey. The log line of each song start now says how long was spent choosing its recording and how long the node took to play it (started N ms after the change began (choosing the recording A ms, the node B ms)), to tell which part is slow.

  • Music: autoplay, and a list of songs while /music play is typed. /music autoplay (or !autoplay, or its button on the card, off by default) adds songs like the last one when the queue is about to run out: they come from Last.fm (track.getSimilar, and the top songs of similar artists when that gives little), which follows the genre, the language and the artist; what was heard in the session is not repeated, five songs are added each time, they are looked for while the last song still plays (so there is no gap), and a repeat on turns it off. It needs the Last.fm key of the bot (LASTFM_API_KEY, the same one !lastfm uses). While /music play or playnext is typed, Discord shows up to 10 matching songs as "Title - Artist" (found in the same places as a search, kept 1 minute, only for the team while it is tested) and the one chosen plays exactly that recording. The card has 10 buttons (autoplay is the new one).

  • Music: /music search (a menu of results), a bar that moves, and faster changes between songs. /music search creep (or !music search, !music find) shows the best five results (no covers, remixes or repeats) in a menu with the artist, length and where each one is from; the person who searched picks one and it is added like play does (a menu lasts 5 minutes and is used once). The progress bar of the card is made of the three pieces of the music set (a pill that moves along a track). The recordings of the next three songs are chosen while one plays (it was one), a song asked for while it is being prepared is not asked twice, and the log says how long each change took to start (started N ms after the change began), the number to look at when a change is slow.

  • Music: the new look, 50% of volume, Deezer for the team, and a freeze goes on from where it was. The card, its buttons and the status of the voice channel use the emojis of the Petto music server (pe_s_*): the title has the music note, the line of time and volume has its own icons, the next song has the play icon, and when Discord does not take the custom emojis the card is sent again with plain ones. A session starts at 50% of volume (it was 100), which is also the lowest (the card has no button to lower the volume, and /music volume goes from 50 to 150). A song that freezes (Lavalink says it is stuck) now plays again from where it was before the next recording is tried; a second freeze within a minute goes to the next recording. With MUSIC_DEEZER=true songs are also searched on Deezer, its studio recording goes first and its links are played (Pettolava needs its Deezer variables; see its README).

  • Music: playlists without Spotify keys, a faster start, and no dead cards. A Spotify song, album or playlist that Lavalink cannot read (it needs keys) is now read from the public page of the link (title, artist and length of up to 50-100 songs of a playlist; the recording is still searched when each song is about to play). The voice channel is joined while the song is searched instead of after, and the song starts without waiting for the answer to be sent. When Lavalink restarts it comes back without its players: the card now says "the music server restarted" and the server is forgotten (before, the bot thought a song was still playing and play said "added to the queue (place 1)" forever); and a song whose end never arrives (no word from the player for 25 seconds, past the end of the song) is moved on from by itself, so the next song of a list plays. The buttons of the card have a name next to their icon (Back, Pause, Stop, Skip, Repeat, Queue, Vol −, Vol +, Shuffle, Leave) and the pause button says Play while paused.

  • !steal and !jumbo find the emojis of a card. Replying to a message made of the new cards (Components V2, like the ones of other bots or of Petto) found nothing, because only the text, the embeds and the reactions were read. Now the text of the card, the emoji of its buttons and of the options of its menus are read too (the ones of the buttons are how most of those cards show their emojis).

  • Music: the node is really reconnected when Lavalink restarts. The times given to Shoukaku are in seconds and were written in milliseconds: after a restart of Lavalink the bot waited 83 minutes before trying again (so the music said "the server does not answer" until the bot restarted) and a request to a node that was down could hang for hours. It now tries every 5 seconds for 5 minutes (Lavalink takes up to two minutes to start) and gives up on a request after 15 seconds. A check keeps the values in seconds.

  • Music: it comes back when Lavalink restarts, and it does not depend on YouTube. Shoukaku drops the node for good when its reconnect tries run out (Lavalink takes about a minute and a half to start), so after a restart of the node the music said "the server does not answer" until the bot restarted: the node is now put back in the pool every 20 seconds while it is missing. The second recording to try is now from another service than the first (SoundCloud after YouTube), and when YouTube asks for a login ("This video requires login") or blocks the node, the recordings of other services go first for 10 minutes. The log (and #errores-logs) now says what Lavalink said about a track that could not load, not only loadFailed.

  • Music (team only for now): /music, !play, !skip, !queue... Songs in a voice channel from a name or a link of Spotify (song, album, playlist), YouTube or SoundCloud, through a Lavalink node (the new Pettolava repository, on Discloud). A name is searched on YouTube Music and SoundCloud and the results are judged: no remix, cover, slowed, live, karaoke or acoustic version unless the words are in what was asked, the right artist, the right length when it is known, and the official recordings first. A recording that fails goes to the next one, then to the next song, and five in a row stop the player. The card has the picture of !deezer, the time with a bar and buttons (previous, pause, stop, skip, repeat, queue, volume, shuffle, leave), and the status of the voice channel shows the song. Only the owner, the developers and MUSIC_TESTER_IDS can use it until MUSIC_PUBLIC=true; it needs LAVALINK_HOST, LAVALINK_PASSWORD (and LAVALINK_PORT, LAVALINK_SECURE). Not tested with a real node or in a real voice channel yet.

  • Feeds: a Kick live notice is faster and never shows a broken picture. The job looked at the accounts every minute but an account asked every minute is due again a few seconds after one minute, so it was really asked every two (that is why a notice came 3 minutes after the start): now the job makes a pass every 15 seconds (what a platform can be asked in a minute is divided between them, so no limit is touched). The preview of a Kick stream is made some minutes after it starts and Discord can fail to draw it even when its address answers (a broken picture that stays), so a Kick notice now always carries the picture of Kick and is never swapped for the preview (and the live notices of Kick that are open when the bot starts, which may already show a broken picture, are edited once to carry it). The check of the pictures of Twitch reads the first bytes of the image (a CDN can answer 200 with nothing to show). When a stream started more than 2.5 minutes before its notice, the log says so, to tell a slow platform from a slow bot.

  • Feeds: the users and roles written in the words of a feed are mentioned. They were shown as mentions but nobody was notified: only the roles of the ping setting were. What a platform sends (a title, a post) still cannot mention anyone, and @everyone only when the feed asks for it.

  • Feeds: a YouTube Short is posted as the player. A Short now goes as the plain link (Discord draws the playable Short itself, with the words of the feed above it if there are any) instead of a card with no picture; player: false in the options of a feed brings the card back. Videos keep their card unless the feed asks for the player.

  • Feeds: the button that opens the notice is on by default, with the icon of the platform. A feed that does not say otherwise gets the button ("Watch on YouTube", "Watch live"…), so when Discord ruins the title the notice still opens; it can be turned off in the feed. Feeds that already had it turned off keep it off.

  • Feeds: a Kick stream that ended keeps its green and has a replay button. The card that closes a stream was turned grey (it looked black); it now keeps the color of its platform. Kick gives no link to one replay, so the button "Watch the replay" opens the videos of the channel. When it ends, the card also tells the most viewers the stream had (Kick and Twitch give no total, so it is the peak the bot saw). A title with emojis keeps its blue link (Discord does not draw a link whose words hold an emoji, so the emojis are left out of the link; the button still opens it). The status of the bot now says "Multipurpose bot for your server".

  • Feeds: a card with only a title has no empty space, and a pushed video has its description. A card whose only text is the title (no description, nothing else) is now plain text instead of a section with the picture of the account, which was as tall as the picture and left an empty space under one line. The video a push brings has no description in the push, so it is read from the call that already says whether the video is live (no extra quota), and the card has it like any other.

  • Feeds: music is not only about one artist. On Deezer, Apple Music and Spotify, playlists (Deezer and Spotify: the songs added to them are posted), charts (Deezer by genre, Apple Music by country: a song or album that enters the top 10 is posted; type top rock or top colombia in the dashboard) and, on Spotify, the new albums of a country (new colombia). The link of a song or an album follows its artist. Apple Music playlists are not possible (Apple does not let bots read them). The search of the dashboard finds public playlists next to the artists.

  • Feeds: lists of what is new. Modrinth can follow the newest projects of a kind (new mods, new shaders, modpacks, resource packs, plugins, data packs) and Steam the lists of its store (new releases, top sellers, coming soon), next to the accounts and games it already followed. These lists can be busy.

  • Feeds: random music, and more animals with more sources. A new auto feed, randommusic: a song picked at random from the charts of a random genre of Deezer, every 5 minutes up to once a day, with the cover card of !deezer. The animals have birds, ducks, capybaras and bunnies next to cats, dogs and foxes, and every animal has several free services: one is used for each time slot and the next one answers when it is down. animals mixes all of them.

  • Feeds: the names of the lists speak your language. The charts, the new albums of a country and the lists of Steam and Modrinth are named in English, Spanish or Brazilian Portuguese (the language of who follows them), and so are the labels of the search of the dashboard.

  • Feeds: what the bot learned about YouTube survives a restart (Redis). With the Redis of Discloud (DISCLOUD_REDIS_URL or REDIS_URL) the bot keeps the videos known not to be live, the streams that were on (so the recording of one that ended is never posted as a new video), the length of each video and the units of the YouTube key spent today, and reads them back when it starts: a restart does not ask about every recent video of every channel again and the count of the day is the real one. Without Redis it works from memory as before. Ten thousand pushed channels are subscribed in about an hour and the look is 600 channels a minute.

  • Feeds: one feed for all the animals. The cats, dogs, foxes, birds, ducks, capybaras and bunnies are no longer a platform each: there is one, animals, that posts any of them or only the ones asked for (!feed add animals 15m cat dog, in English, Spanish or Portuguese: gatos perros). Each choice is a feed of its own. The feeds of the single animals that were already made keep working.

  • Feeds: random music from Deezer, Apple Music and Spotify. randommusic takes a song from the charts of a random genre of Deezer, from the top 100 of a random country of Apple Music or, when the bot has its Spotify keys, from a random search of Spotify: a different service in each slot, the next one when one does not answer. Spotify now says in the log what it answered when it fails (and a wrong id or secret is told apart from a Spotify that is down).

  • Feeds: Modrinth lists in one feed, and they are posted. new:mod+shader follows the newest projects of several kinds in one feed (new:all for every kind), so a server does not use its places on one kind each. The lists of new projects were never posted because their kind of notice was not one a feed had chosen: they are now project notices ("New project"), and the feeds made before get them too.

  • Feeds: YouTube videos and Shorts can show the player. A new option of a feed, player: the bot posts the link (with the words of the feed) instead of the card, and Discord draws the playable video, like a person pasting it. Only for the videos and Shorts of YouTube; streams and everything else keep their card. The dashboard has a switch for it under More options.

  • Feeds: a pushed YouTube video does not wait half an hour. After a push the channel is looked at again at 1.5, 5, 10 and 20 minutes (the feed of a channel can take that long to show a new video), and a channel that pushes is now looked at every 10 minutes (every 30 only when more than 1500 channels are followed). A video whose notice is sent more than 8 minutes after it was published says so in the log (once for each video), and whether a push arrived for it, to tell a late push from one that never came; looking at a channel says nothing.

  • Feeds: a video YouTube pushes is posted without waiting for the feed of the channel. The push already carries the new video (id, title, link), and the feed of a channel can take many minutes to show it, so the entries of a signed push are kept for half an hour and added to what the feed shows when the channel is looked at. A channel that pushes is now looked at every 3 minutes when up to 300 channels are followed (10 up to 1500, 30 beyond). The log says each push that arrives (up to 300 channels) and, once a minute at most, a push that was ignored because the channel is not followed or the signature did not match.

  • Feeds: random music uses all its services. The service of a slot of time was chosen with a product that lost its last bit at a 5-minute pace (the slot number is about 6 million), so the same service was always chosen (Deezer). The hash is now exact (Math.imul) and the service is chosen with its high bits, so Deezer, Apple Music and Spotify (when it has keys) alternate.

  • Feeds: the YouTube search of the dashboard costs less. A name written as one word is tried as an @name first (one unit) before the search of a hundred units; the answers are kept a day; a server has 10 searches of a hundred units a day (60 for all); and the dashboard waits a second without typing (and three letters) before it looks for a YouTube name.

  • Database: what Petto stored for a server it left is deleted 3 days later. The date a server removed Petto is written down (guild_departures); if the server adds Petto again before 3 days, nothing is lost. After that, its settings and everything tied to it (about 190 tables, also the code data of custom commands) are deleted, 25 servers per pass, every 6 hours. A server with a Premium slot in use, or with backups kept in this database, waits. Nothing is decided while the bot is not ready or has loaded fewer servers than Discord says it is in. GUILD_PURGE=false turns it off, GUILD_PURGE_DAYS changes the 3 days and GUILD_PURGE_DRY_RUN=true only writes in the log what would be deleted, with a line at the end of each pass that says how many servers that is. Servers that left before this change get their date when they are first noticed, so their deletion comes 3 days after the update.

  • Database: the copies of avatars of the profile history weigh half. They were the biggest table (212 MB). New copies are saved as WebP at quality 72 instead of 90 (the same 256 px), and the older ones are rewritten in the background, 40 a minute, only when the new copy is at most 85% of the old one. The copies stop growing at 300 MB (AVATAR_COPIES_MAX_MB, it was 1 GB). The space is reused by the database; the size the host shows goes down after a VACUUM FULL profile_history_images.

  • Database: the public threat feeds forget what they stopped listing. After a refresh that brought a real list (100 entries or more), the entries of that feed that it has not listed for 14 days are deleted (malicious_links was 57 MB, 151 thousand rows). What a person reported, and what the team was already alerted about, stays.

  • Database: a second database for the heavy data (PETTO_DATA2_DATABASE_URL). The avatar copies of the profile history and the public threat lists can live in a second PostgreSQL database, so the main one keeps the settings. Without the variable nothing changes. With it, the tables are made there on the first start, what the main database already has is moved over in the background (a piece at a time: written in the second database first, deleted from the main one after, so a stop loses nothing), and the history page keeps finding the copies meanwhile. What the triggers of the main database did for the copies (delete one with its entry or when the history is turned off) is now done by the bot: when the history is cleared or turned off (also from the dashboard), when a person has more avatars than are kept, and an hourly pass for the rest. PETTO_DATA2_DATABASE_SSL works like the other databases. After the move, a VACUUM FULL of profile_history_images and malicious_links in the main database gives its space back.

  • Feeds: pictures by tags. A new auto feed, pictures (!feed add pictures 30m pink): a picture of what is tagged that way, from the public feed of tags of Flickr, the same for every server that wrote the same tags at the same pace. Spanish and Portuguese words for the common colors and things are understood (rosa is pink), and some words are never followed. Pinterest has no public way to search by tag, so this is the way to have the same idea.

  • Feeds: YouTube push (WebSub), like the big bots. The bot asks YouTube's hub to tell it when a followed channel publishes: the hub calls https://<VERIFY_BASE_URL>/webhooks/youtube with the new entry (signed with a secret of each channel), the channel is looked at at once and the notice goes out within seconds, with no quota spent on asking. A channel that pushes only needs a look every 30 minutes (to catch what a push missed); one with a stream announced or on keeps the 5-minute look, because the start of a stream is not always pushed; and when push does not work (no public address, the hub is down, a subscription ran out) everything goes on exactly as before, looking at each channel every 5 minutes. Subscriptions last 5 days and are renewed a day before. The log says once an hour how many followed channels reach the bot by push and how many units of the YouTube key were used today. YOUTUBE_WEBSUB=false turns it off and YOUTUBE_WEBSUB_URL sets another public address.

  • Feeds: the YouTube key keeps inside its daily units. Every call to YouTube is counted (10,000 units a day by default, YOUTUBE_DAILY_QUOTA if Google gave more) and the log says when the day passes 80% and 95%. The search of the dashboard (100 units) stops at half of the day and the way out when the feed of a channel fails (one or two units, the length of a video is asked only once) at 70%, so the live check, which makes every notice possible, never runs dry.

  • Feeds: dogs and a mix of animals, every 5 minutes. Two new auto feeds, dog and animals (a cat, a dog or a fox, a different one each time), next to cat and fox. All the auto feeds (Pokémon, Wikipedia, Chess.com and the animals) can now post as often as every 5 minutes (!feed add dog 5m #perritos). The animal notices no longer say where the picture comes from, it is only the picture.

  • Feeds: /feed add lists the platforms while you type. Discord shows 25 choices at most and there are more platforms than that, so the platform is now picked from a list that filters as it is typed.

  • Feeds are open to every server. They no longer need FEEDS_PUBLIC=true; FEEDS_PUBLIC=false limits them again to the owner, the developers and FEEDS_TESTER_IDS.

  • Feeds: follow an account and post what it publishes. !feed add <platform> <account> [#channel] follows a YouTube channel (videos, Shorts and live streams), a Twitch channel (live), a Kick channel (live), a Bluesky account (posts), a Modrinth project (new versions), a subreddit (Reddit), a Steam game (its announcements), a GitHub repository (releases), an npm or PyPI package (new versions), an anime on AniList (new episodes), a Pinterest profile or board (pins), any blog or news site by its RSS or Atom feed, or the things of the day: the Pokémon, the featured article of Wikipedia and the puzzle of Chess.com; !feed list, remove, test, pause, resume, message and ping manage them (Manage Server; also /feed). Each notice is a Components V2 card (src/feeds/card.js): the title as a link with the emoji of the platform, the picture of the account at the right, the description in small text when there is one, a separator and the cover, in the color of the platform, with an optional line above it for a ping and the words of the server ({feed.title}, {feed.url}, {feed.author}, {feed.description}). A Short has no big picture unless asked, and a stream that ends is edited in place (grey, with the channel and replay buttons). A new feed first marks what the account already has as seen, so nothing from the past is posted; what is posted is remembered (feed_seen), so a restart posts nothing twice; after a long silence only the newest three are posted. Limits, for each platform: Free follows up to 5 accounts of YouTube, 5 of Twitch, 5 of Reddit… and Premium up to 10 of each. Only the team and the testers (FEEDS_TESTER_IDS) can use the feeds while they are tested; FEEDS_PUBLIC=true opens them to every server. Made for many servers: the same account followed by many servers is one request (YouTube and Bluesky are asked every 5 minutes, Twitch every 2 minutes for 100 accounts at a time, Kick every 2 minutes for 50, Modrinth, Reddit, Steam and RSS every 10, GitHub, npm, PyPI, AniList and Pinterest every 15; GitHub is asked with the tag of the last answer so a repository with nothing new costs nothing of its limit, and AniList asks for all the anime at once). A link typed for an RSS feed is only fetched from public addresses (never the bot's own network), the work is spread over the minutes, a platform that fails is asked less and less often, and a feed that cannot post five times in a row is turned off. YouTube streams need the YOUTUBE_API_KEY the bot already has for !youtube (one call per 50 new videos, and what is known not to be live is never asked again); Twitch needs TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET; Kick needs KICK_CLIENT_ID and KICK_CLIENT_SECRET (an app made in kick.com > Settings > Developer). The dashboard has its routes (src/web/feedRoutes.js) to look up an account, follow it, change a feed, post a test and preview the card. New tables feeds, feed_seen and feed_live, and scripts/check-feeds.js.

  • Feeds: search while you type. The dashboard looks for the accounts that match what is typed (YouTube, Twitch, Bluesky, Steam, GitHub, Modrinth, npm and AniList; the others answer with the account of a link or a name) and shows them with their picture to choose one (POST /api/dashboard/guild/:id/feeds/search, up to 40 a minute for each server, kept five minutes; YouTube searches cost 100 units of its daily quota, so they are capped at 60 a day and a link or an @name is looked up instead).

  • Feeds: seven new platforms. Spotify (new releases of an artist and new episodes of a podcast; it needs SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET), Deezer and Apple Music (new albums and singles of an artist; no key), Mastodon (any server, @name@server), Tumblr, Letterboxd (the diary of a person) and the free games of Epic Games of the week, in the language and country of each server. The dashboard searches artists and podcasts while you type. There are two new kinds of notice, release and game, and /feed has the new platforms.

  • Feeds: the auto feeds post every X minutes. The Pokémon, an article of Wikipedia and a puzzle of Chess.com can post from every 15 minutes to once a day (!feed add pokemon 30m, or the new "How often" box of the dashboard; the pace of a feed can be changed later). Every server that picks the same pace gets the same notice at the same time, and the services are asked once for each slot, not once for each server. A feed made before this keeps posting once a day.

  • Feeds: cats and foxes. Two new auto feeds, cat and fox: a picture every 15 minutes to once a day (!feed add cat 1h #gatitos), the same for every server that picked that pace (TheCatAPI and Random Fox, no key).

  • Feeds: a new look for the releases of music. A new release of Spotify, Deezer or Apple Music is headed by the same picture as !deezer (the cover next to a panel with the title and the artist over the blurred cover), with a button that opens it. If the picture cannot be drawn the card is the ordinary one.

  • Feeds: Twitch notices also carry a stand-in picture (as Kick's) when the preview of the stream does not exist yet, and the real one is edited in when it does.

  • Feeds: a live notice of Kick goes out within a minute. Kick is asked every minute (it was two), and the notice no longer waits for the picture of the stream, which Kick makes a little later: it goes out at once with a picture of Kick and the same message is edited to the real picture when it exists.

  • Feeds: a stream scheduled days before is announced. YouTube streams are asked about even when their page is old, and the notice says when the stream began (not when its page was made, which could show "47 minutes ago" for a stream that had just started).

  • Feeds: the limit of Premium is 25 accounts of each platform (it was 10; Free is 5). The engine keeps the list of feeds in memory (it was read again every minute) and reads the open streams in one go, so a bot with many thousands of feeds asks the database much less. Twitch is asked every minute.

  • Statistics v2: !stats, the analysis of a server, with a privacy panel and a server switch. Everything is counted per server (in GMT-5), only as numbers and never what was written, and set against the period before it:

    • !stats (!stats 30): six numbers with their change in percent and three line charts (messages, voice hours, active members) with the period before as a dashed line. !stats channels (top channels by messages and voice with their share, and the text channels that were quiet), !stats members (top members and how much the top tenth wrote), !stats heatmap (messages by weekday and hour, part of the day), !stats growth (joins, leaves, the members line and how long the members who left had stayed), !stats compare (every number next to the period before, and how many of every 100 messages carry a link, a file, a reply or a mention) and !stats @member (messages, voice time, days in a row, best day, place and share). It was an alias of !summary, which stays as it was (!digest, !weekly).
    • Privacy. !stats privacy (Components V2 panel, three languages): a button to stop being counted (the person is left out of every server, and the counts per member that existed about them are deleted), one to be counted again and one to delete what was counted about them. !statsconfig (Manage Server; view, enable, disable, members on|off, content on|off, delete): a server can count nothing, keep no counts per member, skip the shape of messages, or delete every counter (behind a button only the person who asked can press). Counts per member are deleted after 13 months and the others after two years.
    • New tables (stats_config, stats_optout, activity_content, member_lifespan), counters for the shape of messages and for how long members stayed, and the rules are read into memory so every counter can ask them. Until they were read nothing is counted. scripts/check-stats-v2.js checks the numbers, the six pictures in three languages, the rules and, against PostgreSQL, the delete, the pruning and the reads.
  • Shorter ways to write the lookups and some moderation commands. !mu Notch is !minecraft user, !ms server, !msk skin, !mh head; !gu, !gr, !grl, !gc, !gi, !gp, !gl for GitHub (user, repo, release, commits, issues, pulls, languages); !ru, !rav, !rg (Roblox); !stp, !stg (Steam); !tc, !tcl, !tt (Twitch); !yv, !yc, !yl, !ys (YouTube); !lr, !lta, !ltt, !ltl, !lwk, !lcp, !la (Last.fm); !dzt, !dza, !dzl (Deezer); !its, !ita, !itp (iTunes); !ami, !mga, !achar (AniList); !cch, !lic (chess). And !ub (unban), !um (unmute), !uj (unjail), !ld (lockdown) and !cs (case). The old ones keep working; scripts/check-short-aliases.js checks that none is the name or the alias of another command.

  • A picture for songs, albums and artists. !deezer (track, album, artist), !itunes (song, album) and !lastfm now draw one picture as the heading of the card: the cover on the left with rounded corners (a circle for an artist), and next to it a panel with the same cover blurred behind the title, the artist and the album. It is made with the same tools as the other image cards (imgutils/songCard.js), kept for ten minutes, and when it cannot be drawn the card is the plain one with the cover. The covers are downloaded with the safe image loader. infoPayload got a hero option for a picture that is the heading itself.

  • Five more lookup commands. !chess (!chesscom, !lichess: ratings by mode, games, title, followers; Chess.com and Lichess), !modrinth (!mr: a Minecraft mod, modpack, resource pack, shader or plugin; start the words with shader, mod... to choose the kind), !crypto (!coin: price in dollars, change today, rank, market, from CoinGecko), !currency (!cur, !convert: !currency 100 usd cop eur; 160 currencies including COP, from ExchangeRate-API, which is credited on the card) and !animal (!cat, !dog, !fox: a random picture). None needs a key.

  • Seven more lookup commands, and more inside the first seven. Same rules as the first ones (cards with no color, link buttons, three languages, a time limit, a cache, a cooldown, prefix only):

    • !deezer (!dz; !song): track (with a 30 second preview and other results), artist (fans, albums, most played songs) and album (date, genre, track list). No key. !itunes (!apple; !itunesapp, !podcast): song, album, artist, app (rating, price) and podcast. No key.
    • !wikipedia (!wp): the summary of an article, in the language of the server (English, Spanish or Portuguese). No key.
    • !anilist (!ani; !anime, !manga, !animechar): anime, manga and characters, with the spoilers of the description cut. Titles for adults only show in a channel marked as age-restricted. No key.
    • !pokemon (!pkmn, !pokedex): types, height, weight, abilities, base stats and the Pokédex entry (in Spanish when the server speaks it). No key.
    • !package (!pkg; !npm, !pypi): version, weekly downloads, license, size and the repository of an npm package or a PyPI project. No key.
    • !tmdb (!movie, !tv): a movie or a series with score, genres, release and synopsis, asked in the language of the server. Needs TMDB_API_KEY (the v3 key, or the v4 read token).
    • !minecraft server (!mcserver; !mc hypixel.net also works): online or not, players, version, message of the day and the icon. !github: commits, issues, pulls, languages and contributors. !roblox: avatar and group (by id, link or name). !steam games: the games someone played the most. !twitch: clips and top (the most watched streams). !youtube: latest (the newest video of a channel) and search (five results). !lastfm: topalbums, artist (and how many times you played them), compare (how alike two members' music is), and whoknows (who in the server listens to an artist the most, from the members who linked their name).
    • Not added on purpose: Pinterest (its API needs an approval that is rarely given), SoundCloud (registering an app needs a paid Artist Pro plan) and Spotify (since 2026 its API asks for the owner's Premium and limits the users).
  • Lookups on other services: !minecraft, !github, !roblox, !steam, !twitch, !youtube and !lastfm. A new Integrations category of !help. Each one answers with a card (no color) and has a link button, in English, Spanish and Portuguese, as prefix commands like the rest of Petto.

    • !minecraft (!mc; !mcuser, !mcskin, !mchead): the UUID (with dashes), the skin model, whether there is a cape, the skin full body or the head big, and buttons to download the skin and open NameMC. It needs no key (the Mojang API); the pictures are drawn by mc-heads.net.
    • !github (!gh; !ghuser, !ghrepo, !ghrelease): a user (followers, repositories), a repository (owner/name or its link: stars, forks, language, license, topics) and its latest release (notes and downloads). No key; without PETTO_GITHUB_TOKEN GitHub allows 60 calls an hour for the whole bot, so the answers are kept 5 minutes.
    • !roblox (!rbx): by name, id or profile link: display name, friends, followers, groups and the face. No key.
    • !steam: by custom name, Steam id or profile link: level, games, what they are playing and the games of the last two weeks (a private profile shows only the basics). Needs STEAM_API_KEY.
    • !twitch: whether a channel is live, its title, game, viewers and a preview. Needs TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET; the token is asked for once and kept.
    • !youtube video (!yt; !ytvideo) and !youtube channel (!ytchannel): a video from its link or from words to search (views, likes, length) and a channel from its @handle, link or id (subscribers, videos, views). Needs YOUTUBE_API_KEY; a link or a handle costs the daily quota almost nothing, but a search costs much more, so a search can be asked every 5 seconds and the answers are kept 10 minutes.
    • !lastfm (!lfm; !np and !nowplaying for now): link your Last.fm name (it checks that it exists, and it works in every server), now, recent, profile, topartists and toptracks (by period) for you or another member who linked theirs, and unlink. Needs LASTFM_API_KEY. New table lastfm_links.
    • A command whose key is not set answers "not set up" without calling anything. Every lookup has a time limit, a cooldown per person, a cache, and its own message for not found, private, the service being down and a limit being reached. What strangers write (bios, descriptions) cannot ping anyone or make a link.
  • !jumbo (also !bigemoji and !enlarge). Shows a custom emoji (moving ones too), an ordinary emoji or a sticker big, in a card with no color, with its name, kind, creation date and ID and a link to the original picture. Type the emoji after the command or reply to a message with an emoji or a sticker. When the server does not have it yet, the card has a Steal button that adds it for whoever presses it, if they may manage emojis and stickers. Lottie stickers have no picture, so they are told and not shown.

  • XP rules: two new limits. daily_xp_cap is the most XP a member can earn from messages in a day (the day changes at midnight in Colombia; 0 turns it off; the daily and streak bonus come on top of it), and it holds even when several messages arrive at the same moment. voice_alone_percent is the share of the voice XP someone earns while they are the only person in the channel (100 changes nothing, 0 gives nothing while alone). Both are in /level rules and !level rules, in the summary it shows and in the dashboard's Rules page.

  • A level-up card in the Petto style. The new levelup preset of the rank and level-up card shows the avatar, the name, a #rank chip, "You are now in Top X%" and a hexagon from the previous level to the new one. It can also show the member's avatar decoration and their nameplate; each one is a switch of the card. New variables: {level_top_percent}, {user.avatar_decoration}, {user.nameplate}, {user.server_tag} and {user.server_tag_badge}. Image cards got what this needs: layers that appear only when a value is not empty (showIf), layers that follow the right edge of another one (follow), a pill behind a text, a line limit for texts and a hexagon shape (up to 20 layers per basic card). The level-up notice now knows how many members are ranked, so the percentage is right.

  • A decoration that moves on the level-up card (Premium). The Level-up card has a new switch, animateDecoration: when the member's avatar decoration is an animated one, the card goes out as an animated PNG (APNG) with the decoration moving, and only that part of the picture is stored again for each frame, so it stays small (a card of about 250 KB). It is off by default, a server without Premium keeps the still decoration, and a card that would be too big goes out still. Discord does not say whether it plays an animated PNG sent by a bot in every place, so try it before relying on it.

  • !userinfo and !serverinfo redesigned, with no color. !userinfo draws the avatar decoration on the avatar of the card (as Discord shows it) and shows the server tag next to the name, with a flat bullet on each row (no 3D icons); !serverinfo is organized in two blocks (people and channels, about the server) and also shows the invite splash. The card editor's preview in the dashboard tells which of these the person previewing has (X-Card-Look).

  • !usercosmetics (also !uc and !cosmetics). One picture with the row of a profile as Discord shows it: the nameplate behind, the avatar with its decoration (moving when it moves), the name and the server tag. Under it, the details of each one and links to the pictures. A member with none of them says so.

  • Thicker hexagons on the level-up card, and no server tag on it. The two level hexagons are wider and have a thicker outline, and the server tag is not drawn by that layout ({user.server_tag} is still a variable for any card).

  • The cards of Petto have no color, except to say yes or no. A card (Components V2) has no color on its side unless it is green (it went well) or red (it was refused, or it needs attention): a message that starts with the "approved" icon is green, and one that starts with the "denied", "alert" or "warning" icon is red, with no need to choose it in each place. The sanction cards keep their own colors, and so does a color a server owner picks for its panels, forms or confessions. The grey, purple, yellow and orange sides of the info commands, !version, the lists, the polls, the verification and ticket cards, the requests, the reports and the usage cards are gone. Appeals are green when accepted and red when rejected, and a form is green when accepted and red when denied.

  • No big titles. The cards use ### or bold for a title, never # or ## (the headings of the info cards, !version, the case list, the honeypot panel, the setup texts and the sanction designs; the quests and the rollouts are left as they were). !version also lost its 3D icons.

  • check-card-colors checks all of this, and that every type of sanction has its color, icon, bar and sentences in the three languages.

  • Flat icons only. The colorful icons of the application (alert, denied, changelog, eyes, reload, computer, note, more, minus, magic, locked, link, bug, metal, gear, rocket, and the pixel star, alert, loading and question) are no longer used: each one was replaced by the grey, flat icon of its design (or by the green check, red cross and warning that stay), in !version, the cards and the messages.

Changed

  • Docs: the optional keys of the feed of pictures (PIXABAY_API_KEY, UNSPLASH_ACCESS_KEY, PEXELS_API_KEY, GOOGLE_CSE_KEY, GOOGLE_CSE_CX) are in the reference, and the pictures work with none of them.
  • The music is turned off. The code stays (nothing was deleted) but MUSIC_ENABLED is off unless it is true: nothing connects to the Lavalink node (the library that does it is not even loaded), /music is taken out of the list of commands of Discord, and !play and the other short forms, the buttons of a card, the menu of a search and the suggestions while typing answer "The music is turned off for now." (or give nothing, for the suggestions). MUSIC_ENABLED=true turns it on again (it also needs LAVALINK_HOST and LAVALINK_PASSWORD).
  • The lookup commands work without the subcommand word. !mc Notch is the user, !gh octocat is a user and !gh PettoBot/petto-bot (or a link) is a repository, !yt @handle or !yt urugodd is a channel while a video link or several words are a search, and !lfm alone (or with a member) is what is playing now. Short words also work: !lfm songs, !lfm me, !mc avatar. A command can now give prefixDefaultSubcommand as a function of the words typed. The same change fixes !roblox, !steam and !twitch with nothing after them: they sent a report to the error channel instead of showing how to write the command.
  • The alerts and refusals have their color back. The cards of a warning have the yellow of the warnings again (the usage card of a command written wrong or with an option missing, a help that finds nothing, the counting alerts, the reminder of an unclaimed ticket, the scam alert, a partner reply that asks for a wait, a slow ping, the restore of a backup), the red stays for a refusal and the green for a confirmation. A text that starts with ✅, ❌ or ⚠️ also gets its color.
  • The setup of a new server is never put in a public channel. When Petto cannot make its private setup channel, the setup message now goes by direct message to whoever added Petto (not to the owner, who did not ask for it), and if that cannot be done to a channel that the whole server cannot see. Before, it went to the system channel or a public channel, where everybody could read it.
  • Counters are no longer turned off for a channel that still exists. A counter whose channel was not in the bot's memory for a moment (a shard that reconnects, the start of the bot, a server that is briefly unavailable) was turned off with "the channel is gone". Now the bot asks Discord first and only turns the counter off when Discord says the channel does not exist; if it cannot tell, the counter waits for the next pass. A counter that was already turned off this way turns itself on again when its channel is found.
  • "Service degradation detected" has its yellow again. The status card of a degraded service (and the warnings of the host log) lost their side color in the redesign; they are the yellow of the warnings again, next to the green of "All services operational" and the red of an outage.
  • !jumbo says when the server already has the emoji or sticker. The card shows a small note instead of just leaving out the Steal button.
  • Newer packages and Node 24 in the checks. @napi-rs/canvas goes from 1.0.8 to 1.0.13 (it draws text and gradients like Chrome; the text of the image cards sits about 3 pixels higher) and dotenv from 17 to 18 (fixes in the .env reader). The GitHub checks run on Node 24 instead of Node 20, which stopped receiving fixes in April 2026, and engines asks for Node 22 or newer.
  • The Steal button of !jumbo answers and locks. It failed with "Invalid Form Body" because the answer did not say it was a Components V2 message. Now the button is locked as soon as it is pressed (it says Adding… and then Stolen, or is free again if it failed), a second press at the same time is told to wait, and the result is a private message.
  • Warnings are yellow again, not red. A card that starts with the warning icon (such as the one of an unknown command) has the yellow-orange side bar it had before the redesign. Red stays for refusals, and green for confirmations.
  • Dividers between the parts of a card. A text card with a ### heading in the middle (such as !appeals, with its settings under the intro) now puts a divider before that heading, and the cards that stacked several blocks with nothing between them (the backup panel, the owner guide, the verification link) have their dividers too.
  • Voice XP no longer needs a second person by default. "People needed in voice" (voice_min_members) started at 2, so someone alone in a voice channel earned nothing and it looked broken. It is 1 now for new servers, and servers that still had the old 2 are moved to 1 once (they can set 2 again from Rules and events or /level rules; a later restart does not reset it). The rule is still there.
  • "People needed" counts people who could earn XP themselves. Bots and deafened members (and muted ones when the server ignores muted members) no longer count as company, so one person with someone deafened next to them is still one.

Fixed

  • The verification page opens in the language of the server. The page chose its language from the browser of whoever opened it before the language of the server, so a link sent by a server in English opened in Spanish for a member whose phone is in Spanish, while the message that carried it was in English. The link now carries ?lang= with the language of the server (the page already read it first); a member who opens a plain link keeps the old rule.
  • Music: a timeout of the network is tried once more. When Lavalink says a song failed because the network timed out (the Read timed out of the log), the same recording is played again once before the next recording is tried (the next one would meet the same hiccup); a second timeout, or any other failure (a login asked by YouTube, a video that is gone), goes to the next recording as before.
  • When a lookup is "unavailable", the log says why. !pokedex, the lookups of the integrations and the feeds answered "unavailable" without saying whether the service answered an error, timed out or could not even be reached (DNS, a reset connection), so a failure of PokéAPI could not be told from a failure of the bot's host. The error now carries the word (timeout, ENOTFOUND, ECONNRESET, a status...), shown in #errores-logs (Feeds: pokemon could not be asked: unavailable: timeout) and in a new line for the commands. A network failure that happens at once (not a timeout) is asked again one time.
  • /music shows in Discord. The command was only ever usable with the prefix (!play, !music ...) because it was not marked to be registered as a slash command (registerSlash), so Discord never had /music (nor its list of suggestions or /music search). It is registered now (66 slash commands).
  • Feeds: a YouTube channel whose feed answers 404 or 500 keeps working. YouTube's feed sometimes fails for a channel that exists (the errors log showed could not read what youtube/UC… already has: notFound); the uploads list of the API (two units) is used then, and a failure of both is treated as YouTube having trouble, not as a channel that is gone. The message of a platform that is not set up now says its keys are missing.
  • The URLhaus list of malicious links is read again. urlhaus.abuse.ch/downloads/text/ answers 410 Gone since abuse.ch closed its public downloads (the errors log showed Feed returned HTTP 410); the list made from it every twelve hours by malware-filter is used, which needs no key.
  • Kick live notices wait for the picture of the stream. Kick makes the thumbnail a little after a stream starts, so a notice posted seconds later showed a broken picture. The notice now waits (up to four minutes, the stream still counts as live) until the picture loads, and goes without it after that.
  • A title with square brackets shows as a link. A video called [Stream 56] was posted as the plain text [...](https://...) because Discord does not read a link whose words hold an escaped bracket; the brackets of a title are written as the full-width ones now.
  • Pinterest boards with names in other alphabets can be followed. The link of a board such as /user/%E0%B1%A8-k-pop/ was refused; it is accepted now.
  • The statistics counters filled the error channel with Unsupported PostgreSQL RPC. The two counters added with Statistics v2 (increment_activity_content and increment_member_lifespan) were not in the list of functions the database layer knows (RPC_SIGNATURES), so what they count was kept for retry and never saved. They are in the list now, and scripts/check-stats-v2.js checks that every counter function it calls is known to the layer.
  • !massunban kept going after the server was gone. When the server disappeared (or Petto lost access or the Ban Members permission) in the middle of the list, it tried every ban and failed the same way each time (300 warnings in the log, one call to Discord for each), and then failed again when there was no channel left to answer in. It now stops at the first Unknown Guild, Missing Access or Missing Permissions, checks that the server is still there before each unban, says why it stopped, and does not fail when it cannot show the result. A single failed unban still goes on with the list. New scripts/check-massunban-gone.js.
  • AFK mentions were never deleted. /afk mentions shows the last three days, but the table kept every mention for ever. A job now deletes, once an hour, what is older than three days (and an index on the date makes that cheap). What the member sees does not change. New scripts/check-afk-mentions-expire.js.