telegram

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 3 Imported by: 1

README

telegram

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultServeMux = &ServeMux{commands: make(map[string]Handler)}

Functions

func Handle

func Handle(pattern string, handler Handler)

func HandleFunc

func HandleFunc(pattern string, handler func(*ResponseWriter, *Request))

func ListenAndServe

func ListenAndServe(token string, handler Handler) error

Types

type Handler

type Handler interface {
	Serve(*ResponseWriter, *Request)
}

type HandlerFunc

type HandlerFunc func(*ResponseWriter, *Request)

func (HandlerFunc) Serve

func (f HandlerFunc) Serve(w *ResponseWriter, r *Request)

type Request

type Request struct {
	tgbotapi.Update
}

type ResponseWriter

type ResponseWriter struct {
	tgbotapi.MessageConfig
}

type ServeMux

type ServeMux struct {
	// contains filtered or unexported fields
}

func NewServeMux

func NewServeMux() *ServeMux

func (*ServeMux) Handle

func (mux *ServeMux) Handle(command string, handler Handler)

func (*ServeMux) HandleFunc

func (mux *ServeMux) HandleFunc(command string, handler func(*ResponseWriter, *Request))

func (*ServeMux) Handler

func (mux *ServeMux) Handler(r *Request) (Handler, error)

func (*ServeMux) Serve

func (mux *ServeMux) Serve(w *ResponseWriter, r *Request)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(token string) (*Server, func() error, error)

func (*Server) Serve

func (s *Server) Serve(handler Handler) error

Jump to

Keyboard shortcuts

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