Ghostty Discord bot
  • Python 99.7%
  • Just 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
trag1c 65640183bf
move from basedpyright to ty (#593)
Note that this is using the default config and we can probably tweak it
a bit to be more aggressive; running with `--error all` yields 70
diagnostics, though most of them are caused by the following rule, which
I'd say is *too* aggressive:
```py
def foo() -> str | None: ...

if x := foo():
    assert len(x) > 0
```
```
error[truthiness-test-of-none-union]: Boolean test on `str | None` does not distinguish `None` from other falsy values
 --> foo.py:3:4
  |
3 | if x := foo():
  |    ^^^^^^^^^^ `None` and the empty string are both falsy
help: Use `is None` or `is not None` to check for presence of the value
help: Use `bool(...)` if testing truthiness is intentional
```
2026-11-15 17:56:25 +01:00
.github/workflows move from basedpyright to ty 2026-11-13 19:33:18 +01:00
app move from basedpyright to ty 2026-11-13 19:33:18 +01:00
packages/toolbox move from basedpyright to ty 2026-11-13 19:33:18 +01:00
tests move from basedpyright to ty 2026-11-13 19:33:18 +01:00
.editorconfig Add an editorconfig file. 2026-01-17 12:34:13 +11:00
.gitignore move to a TOML config 2026-04-03 17:19:14 +02:00
.python-version chore: upgrade python to 3.15 2026-11-13 19:28:52 +01:00
config-example.toml don't rely on roles for auth 2026-11-05 21:55:22 +01:00
CONTRIBUTING.md move from basedpyright to ty 2026-11-13 19:33:18 +01:00
justfile move from basedpyright to ty 2026-11-13 19:33:18 +01:00
LICENSE build: drop nix, migrate to uv 2025-02-18 19:40:42 +01:00
pyproject.toml move from basedpyright to ty 2026-11-13 19:33:18 +01:00
README.md drop the Zig code blocks feature 2026-11-06 21:46:07 +01:00
uv.lock move from basedpyright to ty 2026-11-13 19:33:18 +01:00

Ghostty Discord Bot

The Ghostty Discord Bot, humorlessly named "Ghostty Bot."

It originally powered the invite system during Ghostty's private beta period, successfully inviting ~5,000 people. It now serves as the community's helper bot, making development discussion and community moderation more efficient.

For bot setup and project structure, see CONTRIBUTING.md.

Features

/docs

A command for linking Ghostty documentation with autocomplete and an optional message option:

/docs command autocomplete /docs command message option

If a message is provided, a webhook will be used to send the message under the interactor's server profile.

/close

A command group to mark help channel posts as resolved, with various options for different resolution scenarios:

Command Applied tag Argument Additional information
/close solved Solved Config option (optional) Links to config documentation (if option provided)
/close wontfix Stale - Adds "WON'T FIX" to post title
/close upstream Stale - Adds "UPSTREAM" to post title
/close stale Stale - -
/close moved Moved to GitHub GitHub entity number Links to the GitHub entity
/close duplicate Duplicate Help post ID/link or GitHub entity number Links to original post or GitHub entity

#help channel moderation

Similar to /close, posts in the #help channel are automatically closed after one day of inactivity when they have been marked as solved using the post tags. Information about a #help channel scan is also published in the bot log channel.

Bumps to old solved posts (older than one month) are also handled by warning the user and locking the thread, to prevent often unrelated help requests in posts that are no longer relevant.

Entity mentions

Automatic links to Ghostty's GitHub issues/PRs/discussions ("entities") when a message contains GitHub-like mentions (#1234). It reacts to message edits and deletions for 24 hours, while also providing a "❌ Delete" button for 30 seconds in case of false positives. A "❄️ Freeze" button is also provided to stop reacting to message edits and deletions. Mentioning entities in other ghostty-org repos is supported with prefixes:

On top of that, any GitHub repository can be mentioned, either with owner/repo#1 (e.g. astral-sh/uv#8020), or repo#1, where the bot will try finding the most popular repo with that name (e.g. rust#105586).

A full GitHub URL (such as https://github.com/ghostty-org/ghostty/pull/4876) will also be responded to in a similar fashion, and the original GitHub embed will be suppressed.

The bot also keeps a TTL cache to avoid looking up the same entity multiple times (with data being refetched 30 minutes since last use), making the bot more responsive (the example below can take ~2s on first lookup and ~5ms on subsequent lookups).

Entity mentions example

Ghostty Bot responds to GitHub code range links with code blocks containing the linked code. Same edit/delete hook and TTL cache rules apply.

Code links example

Entity comments

Comments on issues, PRs, and discussions are displayed by the bot when linked. A subset of GitHub events (e.g. "requested review", "closed the issue", "added label") is also supported. Same edit/delete hook and TTL cache rules apply.

Entity comments example

Commit mentions

Ghostty Bot responds to messages containing commit hashes (such as b7913f0 or a8b9dd8dfc7a2cd6bb3f19969a450497654a47b0) with information about the mentioned commit. The same prefixes used for entity mentions is also supported by using an @; e.g. bot@4841da1. Arbitrary repositories can also be mentioned with a syntax similar to entity mentions; e.g. python/cpython@2a6888e or zig@39aca6f37e83e263236339f9.

Commit mentions example

XKCD mentions

Similar to the above feature, entity mentions with a prefix of xkcd, such as xkcd#1172, will be replied to with an embed containing the XKCD's contents. Message edits and deletion are also handled, and a "❌ Delete" button is provided for one hour. A "❄️ Freeze" button is also provided to stop reacting to message edits and deletions.

XKCD mentions example

Embed fixups

Ghostty Bot automatically fixes broken or missing embeds for social media links. When a message contains a link to X/Twitter or Pixiv, the bot suppresses the original embed and replies with a working alternative (using fixupx/fxtwitter and phixiv respectively). Message edits and deletion are also handled, with the standard buttons provided.

Message filters

This feature takes care of keeping the #showcase and #media channels clean. The bot will delete any message:

  • without an attachment in #showcase
  • without a link in #media

It will also DM users about the deletion and provide an explanation to make it less confusing:

Message filter notification

Moving messages

Used for moving messages to more fitting channels (e.g. off-topic questions in #development to #tech).

Move message example

Ghostty troubleshooting questions can be turned into #help posts with a related feature:

Turn into #help post example

The author of a message can also modify moved messages using an entry in the context menu, which gives them the following:

  • a Delete button: removes the moved message, without any further confirmation.
  • an Edit via modal button: displays a text box to them that is pre-filled with the existing message content, allowing them to modify it almost like with the normal Discord edit option.
  • an Edit in thread button: creates a new private thread in the current channel, adds them to it, then provides them with instructions on how to continue. In channels that don't support private threads, this button isn't shown.
  • a Help button: displays information about both editing options to them.

If the message has one attachment, a "Remove attachment" button is also shown, which removes the attachment without any further confirmation; if the message has multiple attachments, a "Remove attachments" button is shown which provides the user with a selection menu that allows them to select which attachments are to be removed.

https://github.com/user-attachments/assets/8c8ed1cf-db00-414f-937f-43e565ae9d15