telegram

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: MIT Imports: 6 Imported by: 2

README

telegram-simple-message

Install
go get "github.com/evgeny-klyopov/telegram-simple-message"
Usage
import "github.com/evgeny-klyopov/telegram-simple-message"

func main()  {
	client, _ := telegram.NewClient(telegram.Config{
		UseProxy: true,
		Proxy: "user:password@ip:port",
		Token: "DDDDDDDDDD:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
		ChatId: -0000000000000,
	})

	_ = client.Send("*test*", telegram.MarkdownTypeMessage)
	_ = client.Send("<b>test</b>", telegram.HtmlTypeMessage)
}
Help

Documentation

Index

Constants

View Source
const HtmlTypeMessage = "html"
View Source
const MarkdownTypeMessage = "markdown"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg Config) (*Client, error)

func (*Client) GetBot

func (c *Client) GetBot() *tgbotapi.BotAPI

func (*Client) Send

func (c *Client) Send(message string, typeMessage string) error

type Config

type Config struct {
	UseProxy bool   `json:"use_proxy"`
	Proxy    string `json:"proxy"`
	ChatId   int64  `json:"chat_id"`
	Token    string `json:"token"`
}

Jump to

Keyboard shortcuts

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