Skip to content

A Telegram Bot skeleton written in Go (a.k.a. your bot in 20 lines)

License

Notifications You must be signed in to change notification settings

cortinico/telebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telebot Build Status GoDoc

A simple Telegram bot skeleton written in Go.

Usage

You simply need a configuration (BotName + API Key) and a Response function.

Checkout this sample code:

package main

import "github.com/cortinico/telebot"

func main() {
	conf := telebot.Configuration{
		BotName: "SampleBot",
		ApiKey:  "162227600:AAAAAAAAAAABBBBBBBBBBCCCCCCCCCDDDDD"}

	var bot telebot.Bot

	bot.Start(conf, func(mess string) (string, error) {
		var answer string
		switch mess {
		case "/test":
			answer = "Test command works :)"
		default:
			answer = "You typed " + mess
		}
		return answer, nil
	})
}

Licence

The following software is released under the MIT Licence

About

A Telegram Bot skeleton written in Go (a.k.a. your bot in 20 lines)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages