telegram

package
v0.0.0-...-23b227f Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodGet = iota
	MethodPost
)
View Source
const ApiUrl = "https://api.telegram.org/"

Variables

View Source
var Reserved = map[string]string{
	"<": "&lt;",
	">": "&gt;",
	"&": "&amp;",
}

Functions

func EscapeString

func EscapeString(text *string)

func JoinNotEmptyStrings

func JoinNotEmptyStrings(elems []string, sep string) string

Types

type InputMedia

type InputMedia struct {
	Type      string `json:"type"`
	Url       string `json:"media"`
	Caption   string `json:"caption"`
	ParseMode string `json:"parse_mode"`
}

type KeyBoardButton

type KeyBoardButton struct {
	Text string `json:"text"`
	Url  string `json:"url"`
}

type NewPostResponse

type NewPostResponse struct {
	Ok     bool `json:"ok"`
	Result []struct {
		MessageId int `json:"message_id"`
	} `json:"result"`
}

type RemindPostResponse

type RemindPostResponse struct {
	Ok     bool `json:"ok"`
	Result struct {
		MessageId int `json:"message_id"`
	} `json:"result"`
}

type Request

type Request struct {
	Method uint
	Name   string
	Params *map[string]string
	Body   *io.Reader
}

type Settings

type Settings struct {
	Token            string
	ChannelName      string
	ChannelModerator string
	Webhook          string
}

func (*Settings) Post

func (tg *Settings) Post(game *epicgames.Game, silent bool)

func (*Settings) PostNext

func (tg *Settings) PostNext(ga *epicgames.Giveaway) int

func (*Settings) Remind

func (tg *Settings) Remind(giveaway []epicgames.Game) int

func (*Settings) RemoveNextPost

func (tg *Settings) RemoveNextPost(messageId string) error

func (*Settings) RemoveRemind

func (tg *Settings) RemoveRemind(messageId string) error

func (*Settings) Send

func (tg *Settings) Send(req *Request) (*http.Response, error)

func (*Settings) UpdateNext

func (tg *Settings) UpdateNext(messageId string, ga *epicgames.Giveaway)

Jump to

Keyboard shortcuts

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