Skip to main content

Bibi Discord

Bibi/AE to mały, czytelny język do pisania botów Discord. Piszesz plik .ae, a runtime uruchamia go przez discord.py.

Szybki start w Replit

W terminalu projektu:

cd bibi-discord
python3 -m pip install -e ".[dev]"
bibi check example/bot.ae

Dodaj sekret DISCORD_BOT_TOKEN w zakładce Secrets. W panelu Discord Developer Portal włącz też Message Content Intent, ponieważ Bibi obsługuje komendy tekstowe.

Uruchom bota:

bibi run example/bot.ae

Składnia

bot "Mój bot" {
  token env "DISCORD_BOT_TOKEN"
  prefix "!"

  on ready {
    log "Bot działa!"
    status "z Bibi"
  }

  command "ping" {
    reply "Pong!"
  }

  command "hello" {
    reply "Cześć, {user}!"
  }
}

Dostępne akcje to reply, log i status. W tekście możesz użyć:

  • {user} — wyświetlana nazwa autora wiadomości,
  • {user_id} — ID autora,
  • {server} — nazwa serwera lub DM,
  • {args} — argumenty po nazwie komendy.

Podpowiedzi podczas pisania

W projekcie są gotowe snippetsy w .vscode/bibi.code-snippets. Otwórz lub utwórz plik z końcówką .ae, a następnie wpisz na przykład bot, command, ready albo reply i wybierz podpowiedź z Ctrl+Space. Snippet wstawi cały blok kodu i przeprowadzi Cię po polach klawiszem Tab.

To jest pierwszy etap budowania języka. Kolejny etap to osobne rozszerzenie edytora z kolorowaniem składni i inteligentnym LSP, które będzie znało komendy, błędy oraz dostępne zmienne.

Edytowanie języka

Instrukcja rozwijania składni, runtime'u, podpowiedzi i testów znajduje się w pliku EDYCJA_JEZYKA.md w repozytorium projektu.

Po opublikowaniu pakietu każdy może go zainstalować:

python3 -m pip install bibi-discord

Publikowanie i aktualizacja PyPI

Token PyPI trzymaj wyłącznie w Replit Secrets jako PYPI_API_TOKEN. Nie wpisuj go do pliku, komendy ani repozytorium.

Sprawdź pakiet i opublikuj aktualną wersję:

cd bibi-discord
bibi publish

Zmień wersję, zbuduj paczkę i opublikuj aktualizację:

bibi update 0.1.1

Przed głównym PyPI możesz użyć serwera testowego:

bibi update 0.1.1 --repository testpypi

Komendy publikacji korzystają z python -m build i python -m twine, ustawiają nazwę użytkownika PyPI na __token__ i pobierają hasło wyłącznie z PYPI_API_TOKEN.

Instalacja jako biblioteka

Po publikacji użytkownik może zainstalować runtime:

python3 -m pip install bibi-discord

Rozwój języka

Parser jest w src/bibi/parser.py, AST w src/bibi/ast.py, a połączenie z Discordem w src/bibi/runtime.py. To daje prostą bazę do dodawania kolejnych zdarzeń, embedów, przycisków i slash commands bez zmiany składni istniejących botów.

Licencja

MIT

Metadata

Release files for bibi-discord 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for bibi-discord 0.1.0
File Interpreter ABI Platform Actions
bibi_discord-0.1.0-py3-none-any.whl Python 3 none any Details for bibi_discord-0.1.0-py3-none-any.whl

Release files / bibi_discord-0.1.0-py3-none-any.whl

Download URL bibi_discord-0.1.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7aa563fd59c27e8d7fafdb1410710427fa4f32527ead62ffe18fcb7aa71942bc
BLAKE2b-256 checksum
How to use checksums
779de35d558d3303d6d2d0129d427a9d2d600ace7c72f8f15ef0be76d7edb42a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for bibi-discord 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page