tgbot

package module
v0.0.3 Latest Latest
Warning

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

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

README

telegram robot msg sender

It's used for send teglegram message to your self

Example

func main(){
    youChatId:=12345678
    token:="52646xxxx:xxxxxxxxxxxxdKJ1gATeWEPgotSe7M"
    tg, err := NewTgBot(youChatId, token)
	assert.NoError(t, err)
	err=tg.Send("hello")
	assert.NoError(t,err)
}

how to get your chat id and token

  • chat id: Forward a message to the user info bot,it will send you the user id
  • token: Just talk to BotFather (described below) and follow a few simple steps.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TgBot

type TgBot struct {
	ChatID   int64
	BotToken string
	// contains filtered or unexported fields
}
var Bot *TgBot

func NewTgBot

func NewTgBot(chatid int64, token string) (*TgBot, error)

func (*TgBot) Send

func (l *TgBot) Send(msg string) error

Jump to

Keyboard shortcuts

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