mirror of https://github.com/tucnak/telebot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
588 B
Go
29 lines
588 B
Go
// Package telebot provides a handy wrapper for interactions
|
|
// with Telegram bots.
|
|
//
|
|
// Here is an example of helloworld bot implementation:
|
|
//
|
|
// import (
|
|
// "time"
|
|
// "github.com/tucnak/telebot"
|
|
// )
|
|
//
|
|
// func main() {
|
|
// bot, err := telebot.NewBot("SECRET_TOKEN")
|
|
// if err != nil {
|
|
// return
|
|
// }
|
|
//
|
|
// messages := make(chan telebot.Message)
|
|
// bot.Listen(messages, 1*time.Second)
|
|
//
|
|
// for message := range messages {
|
|
// if message.Text == "/hi" {
|
|
// bot.SendMessage(message.Chat,
|
|
// "Hello, "+message.Sender.FirstName+"!")
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
package telebot
|