Skip to content

LibraryGo - GoTeleBot is a powerful and easy-to-use Go library for building Telegram bots, providing seamless integration and a wide range of features for developing efficient and interactive bots.

License

Notifications You must be signed in to change notification settings

LibraryGo/gotelebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

LibraryGo - GoTeleBot

A powerful and flexible Telegram bot library for Go!

Logo

🚀 **Coming Soon:** This library is currently for our private use, although we are developing it for public release.

We'll soon release it for public use!


Features

  • Easy Integration: Simple and straightforward integration with your Go projects.
  • Flexible Functionality: Customize and extend the bot's functionality according to your needs.
  • Fast and Efficient: Built using Go's concurrency features for optimal performance.
  • Rich Documentation: Comprehensive documentation to help you get started quickly.

Installation

Download the library with the standard go get command:

go get github.com/LibraryGo/gotelebot/v1

Usage

package main

import (
	"log"
	"os"
	"time"

	"github.com/LibraryGo/gotelebot/v1"
)

func main() {
	// Get bot token from environment variable
	token := os.Getenv("TELEGRAM_BOT_TOKEN")
	if token == "" {
		log.Fatal("TELEGRAM_BOT_TOKEN environment variable is not set")
	}

	// Create a new instance of the bot
	bot, err := gotelebot.NewBot(token)
	if err != nil {
		log.Fatalf("Failed to create bot: %s", err)
	}

	// Add message handler
	bot.AddMessageHandler(HandleMessage)

	// Start receiving updates
	err = bot.StartPolling(&gotelebot.PollingOptions{Timeout: 10})
	if err != nil {
		log.Fatalf("Failed to start bot: %s", err)
	}

	for {
		time.Sleep(time.Second)
	}
}

// HandleMessage is a message handler function
func HandleMessage(bot *gotelebot.Bot, message *gotelebot.Message) {
    if message.Text != "" {
        bot.SendMessage(message.Chat.ID, "You said: "+message.Text, nil)
    }
}

For detailed usage instructions, refer to the documentation.

Contributing

We welcome contributions! If you'd like to contribute to LibraryGo - GoTeleBot, please check out the contribution guidelines.

Get Involved

🛠️ Stay Updated: Fork, star, and watch the repository to keep up with our latest updates. Your support means the world to us. Thank you!

License

LibraryGo - GoTeleBot is licensed under the MIT License.

Contact

Feel free to reach out if you have any questions, ideas, or feedback!


Made with ❤️ by Ankit Chaubey

About

LibraryGo - GoTeleBot is a powerful and easy-to-use Go library for building Telegram bots, providing seamless integration and a wide range of features for developing efficient and interactive bots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published