Skip to content

Petto v0.7.8

Choose a tag to compare

@github-actions github-actions released this 23 Oct 23:31
Immutable release. Only release title and notes can be modified.
9dc3d05

Added

  • Delete the previous message: repeating timers and autoresponders. A repeating timer can delete the message it sent the time before, so the channel only ever has the latest one (timer add ... delete_previous:true, or timer previous <id> <enabled> for one that exists). An autoresponder can delete its own previous reply in the channel before sending the new one (autoresponder add|edit ... delete_previous:true, or --previous with the prefix). Both are off by default, need Manage Messages in the channel, and ignore a message that is already gone. A timer remembers its last message in the new auto_messages.last_message_id column; an autoresponder remembers it in memory, so after a restart its first reply deletes nothing. The interval of a timer takes seconds, minutes, hours, days, weeks, months and years (10m, 2h, 1d, 2w, 1mo, 1y, or together like 3d 4h), never less than 10 minutes. A timer can also send a saved embed (also a Components V2 design), with its text above it or without text: timer add ... embed_template:name, or timer embed <id> <name|none> for one that exists; if the embed is gone the timer sends its text. New columns: auto_messages.delete_previous, auto_messages.last_message_id, auto_messages.embed_template, auto_responders.delete_previous.

  • Clownboard, and boards with more than one emoji. A third reaction board next to the starboard and the monkeyboard: clownboard (aliases cwb, clown) reposts what gets enough 🤡 in its own channel, with its own color, ignored lists and saved embed (variables {clown.…}). Every board can now count more than one emoji (emoji ⭐ 🍌 <:wow:123>, up to five, the first is the main one): whoever reacts with several counts once, and any of them can bring the message to the board. New tables clownboards and clownboard_entries, and a column extra_emojis on the three boards (schema.sql).

  • Media channels: imgonly and urlonly. A channel where only pictures and videos (imgonly add #channel, with options for audio, other files and text next to the picture) or only links (urlonly add #channel youtube x instagram, or any) can be posted. What does not fit is deleted and the person gets a notice that deletes itself (once every few seconds per person). Sites: YouTube, X, Instagram, TikTok, Pinterest, Spotify, Twitch, Kick, SoundCloud, Reddit, Facebook, GitHub, GIFs and Discord; a look-alike address is not the site. One channel can have both rules. Members with Manage Messages and the roles the server chose are never touched; a thread follows its channel. Aliases gallery, imageonly, linkonly; !mediaonlyconfig shows the settings. New table media_only_channels in schema.sql; the dashboard page comes with the web.

  • AI assistant for tickets: calmer replies and a place for more instructions. Replies now have one emoji only (in the header), no emoji on the button or the hand-over notice, and the line under them says that it is an AI and can make mistakes (it no longer talks about staff taking over). The assistant does not use emojis unless the owner asks for them. New field How it should answer (up to 2500 characters: length, format, wording, example replies), kept in ticket_ai_settings.reply_style (new column in schema.sql, added with alter table ... add column if not exists), sent to the model as its own data section that never overrides the fixed rules.

  • AI assistant for tickets: it can read Discord messages and knows the channels. The owner can paste links of up to 10 messages of the server (its rules, for example) in the dashboard; the bot reads them live (a message is read again after five minutes at most, so editing it changes what the assistant knows) and gives their text, embeds and cards to the assistant as data. The assistant also gets the channels the ticket user can see, with their topics (it can be turned off), so it can answer "where is...?" by mentioning the channel. A reply can mention only those channels or the ones the owner wrote in a text; any other channel mention is turned into plain text. New columns ticket_ai_settings.message_links and channel_guide in schema.sql. Needs the bot to see and read the channels of the linked messages.

  • AI assistant for tickets: replies are cards, with a button to talk to a person. The answers of the assistant are Components V2 messages in the same layout as other AI bots: a small header with the bot's own emoji ("Reply to ", linked to the profile), a line, the answer next to the picture of the bot, a line saying it is an AI and a Talk to a person button (only the person who opened the ticket can press it; it tells the team and pings the ticket type's roles, once). When the assistant hands over, the notice replaces the button. The model is told which ticket type was opened (its name and description). When a ticket opens in a ticket type where the assistant is on, it sends a first message, with no model call, in the language chosen for the assistant (the language of the server when it follows the ticket user's); that message is not counted as a reply. Its own earlier replies are read back from the messages, so it keeps its memory after a restart; the first replies, written with the robot emoji, are still recognized.

  • AI assistant for tickets (beta).- AI assistant for tickets (beta). A server can switch on an assistant that answers the person who opened a ticket, from the instructions, knowledge and hand-over list its owner wrote in the dashboard (Tickets → AI assistant, beta, only for the team and for servers staff enabled). It uses Groq (GROQ_API_KEY, and optionally GROQ_MODEL; without a key nothing happens). It answers only the opener, in the ticket types chosen, and stops when a staff member writes or claims the ticket, when its reply limit is reached, when the message matches a hand-over keyword or the model asks for it, or when a token or card number is written (that message is deleted and never sent to the model). Hand-over says the team was told and pings the ticket type's ping roles. Every reply ends with a line saying it is an AI, never mentions anyone, and is counted in ticket_ai_usage. A model failure says nothing in the ticket. The prompt, its fixed safety rules and its caps are the same module the dashboard's test chat uses (src/utils/ticketAiPrompt.js). Needs the new tables ticket_ai_settings and ticket_ai_usage and the function ticket_ai_count_reply in schema.sql.

  • Live tickets on the dashboard. New bot routes for the dashboard's Tickets → Live tickets (src/web/ticketLiveRoutes.js): POST /api/dashboard/guild/:id/tickets/live/list (the open tickets with their type, opener, claimer, age, time of the last message and whether the member waits for the staff), …/messages (the last 50 messages of one ticket: names, avatars, attachments as links, embeds and Components V2 cards in short, plus the members added) and the staff actions …/reply, …/claim, …/unclaim, …/add, …/remove and …/close, which use the same ticket actions as the buttons (claim and unclaim post their cards, close makes the transcript and the logs). A reply is sent as Petto (with the server's ticket look), its first line -# <staff name> · from the dashboard so the member and the transcript show who answered, and it pings nobody (allowedMentions: { parse: [] }); it counts as a staff message for inactivity and the staff count. Access: Manage Server, or a role with the new Tickets section of Dashboard access (view for the reads, edit for the actions; rules saved with Community still open it). Such a member only sees the tickets whose channel they can see, and every action needs the ticket's staff (a support role of its type or Manage Server, and the claimer in exclusive mode), as in Discord. Limits per member: 150 reads and 30 actions a minute, 5 replies in 10 seconds, replies up to 1800 characters. Reads stay short: one database read, Discord's cache, at most one fetch of 50 messages per ticket (shared and reused until a new message arrives) and a few lookups within 650 ms; a close answers within a second and goes on. While someone looks at the live tickets of a server, the bot follows its ticket channels in memory and sends a signal on Redis (petto:tk, at most one every 1.5 s per server) when a message arrives or a ticket opens, is claimed or closes; the website passes it to the open page, which reads the list at once. Servers nobody watches cost nothing. Deploy the bot before the website.

  • Ticket transcripts look like Discord and show Petto as it looks in the server. Petto's messages in a transcript use its nickname and its per-server avatar (the Premium bot profile), not the global ones; messages sent with a custom sender look (webhook) keep the name and avatar they were sent with; members show their server avatar and role color. The page has a header with the server icon and banner, the ticket number and status, who opened, claimed and closed it, the category, open and close times and how long it was open, the reason, the message and attachment count and the participants. Messages are grouped like Discord, replies and "used /command" lines are drawn, Components V2 cards (thumbnails, buttons with emojis, small text) render, there is a light theme (follows the system, with a toggle) and times are shown in the reader's time zone. The look is taken when the transcript is made; transcripts saved before are served as they were.

  • A deleted ticket channel closes its ticket. When the channel of an open ticket is deleted, the ticket is closed ("the ticket channel was deleted", closed by whoever deleted it when the audit log says), logged like a close, and the member can open a new one. A check on start and every 30 minutes closes open tickets whose channel no longer exists, only when Discord answers "Unknown Channel" for a server that is available (never on an outage or a timeout). Deleting an open ticket with Delete now closes it and saves its transcript first.

  • Warmer default ticket messages. When a server uses no saved embed, the panel, the welcome inside a ticket, the claim and unclaim notices, the closed notice and the closed DM are Components V2 cards with a title, the category and number, the opener, who handled it, small hints and emoji buttons, in English, Spanish and Portuguese. Custom welcome embeds and panel texts are unchanged. A claim now posts its notice in the ticket (pinging the opener only when the server asked for it) and answers the staff member privately.

  • !pagination: messages with pages (aliases !pn, !pages, prefix only, Manage Messages). One message of Petto with up to 25 pages of saved embeds or embed codes and buttons to turn them (◀ Page X/Y ▶; from 6 pages also ⏮ ⏭ and a menu to jump to a page). create [#channel] <embed> posts a new one, set <link> turns a message Petto already sent into page 1, then add, update, remove, move, view, list, mode shared|private, restore (also restorereactions/rr), delete [--message] and reset (Administrator, with a confirmation). Anyone can turn the pages: a shared message turns for everyone, a private one (--private) shows each member their own copy. The buttons keep working after a restart; all pages are classic embeds or all Components V2 (mixing is refused); a deleted message or channel removes its record. Free servers can have 25 paginated messages, Premium 50. The dashboard's Embeds page lists them (stop, delete, put the buttons back) and posts new ones from saved embeds.

  • !quote: a message as a black and white quote picture (aliases !q, !miq, prefix only). Reply to a message with !quote, or give a message link or ID, or some text and a member (!quote hola @member): Petto answers with a picture of the author's avatar in black and white fading into black, the words in a large serif font sized to fit, and the name and "@username" under them (no dash before the name). Mentions are written as names, links are shortened, emojis (custom and Unicode) are drawn. --color keeps the avatar in color, --light makes it white, --bold writes heavier.

  • !image <effect>: image effects (alias !img, prefix only): invert, grayscale, sepia, blur, pixelate, rotate, flip, mirror, circle, deepfry, compress and hex, each with its own shortcut (!invert, !bw, !blur 20, !rotate 45, !compress 5, !dominant...). The picture is the one attached, the one in the replied message, a link, a member's avatar or your own. Downloads are limited to 8 MB and 16 megapixels, results to 2048 pixels; a GIF uses its first frame.

  • !hex finds the color of a picture. !color/!hex with a picture, a link or a member (or nothing, for your avatar) answers with its main color and a swatch; with a hex code it previews it as before.

  • Stats on Omniplex. With OMNIPLEX_TOKEN (the bot's token in its settings on omniplex.gg), Petto posts its server count, member count, shards and status to https://api.omniplex.gg/bots/stats when it starts and every 10 minutes, and offline when it shuts down, so its listing shows it online. Without the token nothing is sent.

  • Softbans can be appealed. softban is a new punishment type of appeals, off by default and turned on per server like the others (dashboard, Appeals → Settings, or !appeals types ban, mute, softban). The appeal page lists the member's recent softbans (from !softban or the Honeypot) with their case number, a form can be only for softbans, and accepting the appeal clears the softban case (nothing is left to undo in Discord) and gives the member an invite back, the same as an accepted ban appeal. The appeal page now shows the case number of every Petto punishment.

  • Choose whether sanction DMs carry the appeal link. A new appeal setting: always (the default, what Petto did until now: the sanctions members can appeal), never, or only for some sanctions (ban, tempban, softban, kick, timeout, warn). It applies to every sanction DM that offers the link: moderation commands, AutoMod, anti-scam, the Honeypot and warning escalation, through one helper (appealDmFor / appealLinkFor in src/utils/appeals.js); {case.appeal} in custom sanction messages follows it too. The anti-scam DM ("your account may be hacked") now carries the appeal link as well, under the same rule. !appeals dmlink always|never|<list>.

  • Your own line about appeals in sanction DMs. Up to 300 characters, with {link} (the appeal link, added at the end when the line has none) and {server}, in place of Petto's "Think this is a mistake? Appeal here". !appeals note <text>|off.

  • Wait before appealing. Members can be asked to wait 1 to 720 hours after their latest punishment before they send an appeal (0, the default, is no wait). The appeal page says from when they can appeal and the forms stay locked until then. !appeals wait <hours>|off.

  • !appeals shows and changes these settings (prefix only, Manage Server: !appeals <types|dmlink|note|wait> <value>; the slash commands are unchanged). The number of appeals waiting for an answer now counts the whole server.

Needs schema.sql (four new columns on appeal_config: dm_link_mode, dm_link_types, dm_note, min_wait_hours). Deploy the bot before the website.

  • Easier command blocking (!disablecommand, !dc). The words go in any order and the subcommand can be left out: !dc suggest #cmds, !dc #cmds suggest, several at once (!dc suggest,rank,8ball #cmds), several channels, all for the whole server, a whole !help category (!dc category:fun #general), !dc list [#channel], !dc enable <command> [#channel] and !dc clear [#channel]. Aliases, shortcuts and the server's own aliases are saved as the real command, typos get a "did you mean", and a #channel that does not exist is refused instead of blocking the command everywhere. !dc enable <command> without a channel now turns it back on everywhere.

Fixed

  • !dc suggest #cmds did nothing. !disablecommand needed the word disable first (!dc disable suggest #cmds), so the short form answered with a "not part of the command" card while the dashboard saved the same rule fine. The dashboard and the bot also save the same thing now: the real command name in lower case, once per place (rules saved with an alias, a prefix or twice are tidied by schema.sql and on start, and a unique index keeps them single).

  • Ticket ratings can be given once. After a member rates a ticket, the stars in the DM turn into a "Thanks for rating! ★★★★☆" card instead of staying clickable; pressing a star again says the ticket was already rated, and the first rating is kept (it was overwritten by later clicks and logged each time).

  • Setting up verification from the dashboard no longer times out on big servers. "Set it up" makes a gate role and hides every channel from it, one Discord request per channel, spaced by Petto's own limit of 8 requests a second and done one after the other: on a server with 120+ channels it took 25 seconds or more, the website gave up at 25 seconds and showed an error while Petto kept working (and a second press started it all again, with a second role). Now the dashboard's verification buttons (set it up, post the panel, turn it on) run as a job: the bot answers within 1.5 seconds (a quick one with its result, a long one with "running"), one job per server at a time (a second press follows the one that runs), and the card shows a progress bar ("Setting up… 34/120 channels") by asking GET /api/dashboard/guild/:id/verification/job until it ends, then the result. The channels are edited three at a time instead of one by one, and only where needed: a channel where the gate role already has View Channel set (allowed or denied) is kept as the server chose, and a channel Petto cannot edit is skipped instead of asking Discord for a sure 403. Two callers that need the gate role at once (the dashboard, a member who joins, the panel job, /verify setup) share one instead of making two. /verify setup shows the channels done while a new gate role is set up. Turning it off stays immediate.

  • The verification panel is posted once. Two posts at the same moment (the dashboard's setup, its panel button, the panel job, a retry) each sent their own panel, so the channel could show two identical ones. Posting is now one at a time per server, edits the panel that stands in the channel instead of sending another, deletes another copy of the panel found in the last messages of the channel, and does not send the channel's permission for the gate role again when it is already right.

  • The verification link is a button. Pressing "Get my verification link" answers with a card: a link button "Open verification", when it expires (Discord relative time) and the address written out in case the button does not open; the verification DM has the button too. VERIFY_BASE_URL is cleaned (a trailing slash or a missing https:// no longer breaks the link). When no link can be given (VERIFY_BASE_URL missing, not a web address or pointing to localhost, or VERIFY_TOKEN_SECRET missing), the member is told so and, when the secret is there, offered the letters inside Discord instead (the panel shows that button in place of the link, and new members are still gated with it in their DM), the bot log says once what to fix, and the dashboard's verification card shows a warning.

  • The profile history keeps the old avatars themselves, not just their names. Discord stops serving an avatar soon after it is changed, so the history showed old avatars as broken pictures (or, since the website's last update, as "Discord no longer has this picture"). Now Petto downloads each new avatar the moment it records it and keeps a 256 px copy (WebP; an animated avatar keeps its first frame), so the website's history page and !profilehistory avatars show it for good. The downloads wait in a small queue (two at a time, a failure tried once more) so a burst of profile changes does not flood Discord. After a restart Petto also tries, slowly, the avatars recorded before this update: the current ones and recently changed ones are usually still there; the ones Discord no longer has are marked and not asked again (those cannot be recovered). Up to 100 copies per person, the newest. Deleting your avatars (profilehistory clear avatars, or on the website) deletes their copies, and turning the history off (profilehistory record false) deletes all of your copies at once. Needs schema.sql (new table profile_history_images and two triggers). Deploy the bot before the website.

  • /channel clear no longer fails. As a slash command its "thinking" answer is a message in the same channel, and the clear deleted it, so the answer could not be edited (Unknown Message, 10008) and the error was logged twice. That answer is now left out of the clear, and if the answer is gone anyway the result is sent as a new message.

Changed

  • Command blocking replies are plain cards with no color. !dc answers with the earlier small cards, now with no colored side bar at all (no green, yellow, red or purple), with emojis and an undo hint. The list keeps the earlier header (Disabled commands (N) with the server's name and icon) and no colored bar, grouped by channel with a command count. A member who uses a blocked command gets the usual warning card (the warning icon and their name) with no color, which deletes itself after 10 seconds (prefix), or a private card with no color (slash). Cards and lists can now be drawn with no color (textCard(text, null), noticePayload(text, null), accent: null on a pager list); the other commands keep their colors.

  • Tickets use Petto's own ticket emojis. The ticket buttons (claim, close, transcript, add and remove member, reopen, delete, view transcript), the rating stars, the titles of the welcome, panel, closed notice and closed DM, the claim card and the ticket logs use new application emojis instead of 🎫 🔒 🔓 📄 ⭐ ➕ ➖. "Thanks for rating" shows full and empty star emojis; plain ★☆ stay available (starsText(n, { plain: true })). The setup wizard's first ticket type starts with the ticket emoji; an emoji a server chose for its panel buttons is kept. Priority dots are unchanged. In en, es and pt-BR the emojis are passed to the texts, not written in them.

  • A new look for the verification panel: the server's icon (or Petto's) beside a "Verification" title, a welcome with the server's name, three short steps, the buttons with an emoji and a note at the bottom. The saved designs of the verification DMs (/verify template) are unchanged. In en, es and pt-BR.