botcontext

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package botcontext provides a mechanism to embed and retrieve bot-specific context (Client, EventEmitter, Logger) within a standard context.Context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBotContext

func WithBotContext(ctx context.Context, bot BotContext) context.Context

WithBotContext returns a new context with the BotContext embedded.

Types

type BotContext

type BotContext interface {
	Client() client.ClientWithResponsesInterface
	EventEmitter() eventemitter.EventEmitter
	Logger() logger.Logger
}

BotContext provides access to bot capabilities without coupling to internals. It is embedded in context.Context and passed to handlers.

func FromContext

func FromContext(ctx context.Context) BotContext

FromContext retrieves the BotContext from the context. It returns nil if the BotContext is not found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL