Repository navigation
EN Core Concepts
Andrewkydev edited this page Aug 25, 2026
·
1 revision
Русский: RU-Core-Concepts
- The adapter converts an SDK update into an
event.Event. -
core/appruns global and group middleware. -
core/routerselects a typed event, command, callback, text, regex, or fallback handler. - The handler uses
core/contextto send a portable response. - The adapter converts the
OutgoingMessageback into an SDK call.
-
core/*does not import the Telegram, VK, or Discord SDKs. - Shared logic works through
event.Event,Context, andOutgoingMessage. - Platform-only functionality remains in the adapter and is accessed through typed
From(ctx)helpers. - Plugins are compile-time Go modules, not dynamically loaded binaries.
- Storage holds persistent data; cache only speeds up access.
- The admin backend is optional and does not participate in normal routing.
The root package is intentionally small:
app := astraengine.New("my-bot")
app.Platform(adapter)
app.Use(middleware)
app.Command("start", handler)
app.Storage(store)
app.Cache(cache)
app.Plugin(plugin)Import concrete adapters, storage implementations, and advanced contracts only when needed.