spec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package spec exposes the embedded Telegram Bot API method catalog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name        string   `json:"name"`
	Types       []string `json:"types"`
	Required    bool     `json:"required"`
	Description string   `json:"description"`
}

func (Field) IsFile

func (f Field) IsFile() bool

IsFile reports whether the field accepts an uploaded file.

func (Field) TypeLabel

func (f Field) TypeLabel() string

type Method

type Method struct {
	Name        string   `json:"name"`
	Href        string   `json:"href"`
	Description []string `json:"description"`
	Returns     []string `json:"returns"`
	Fields      []Field  `json:"fields"`
}

func (Method) Short

func (m Method) Short() string

Short returns the first sentence of the method description without the boilerplate "Use this method to" prefix.

type Spec

type Spec struct {
	Version     string            `json:"version"`
	ReleaseDate string            `json:"release_date"`
	Methods     map[string]Method `json:"methods"`
}

func Load

func Load() (*Spec, error)

func (*Spec) Names

func (s *Spec) Names() []string

Jump to

Keyboard shortcuts

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