botcontext

package
v0.0.0-...-889dc0d Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 4 Imported by: 0

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