Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)

Telego • Go Telegram Bot API

Go Reference Telegram Bot API Version
Mentioned in Awesome Go Dis Telegram Chat

CI Status Quality Gate Status Go Report
Coverage Code Smells Lines of Code

Telego logo

Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)

The goal of this library was to create API with same types and methods as actual telegram bot API. Every type and method have been represented in types.go and methods.go files with mostly all documentation from telegram.

Note: Telego uses fasthttp instead of net/http and jsoniter instead of encoding/json.

📋 Table Of Content

Click to show • hide

⚡️ Getting Started

How to get the library:

go get -u github.com/mymmrac/telego

Make sure you get the latest version to have all new features & fixes.

More examples can be seen here:

Click to show • hide

Note: Error handling may be missing in examples, but I strongly recommend handling all errors.

🧩 Basic setup

▲ Go Up ▲

For start, you need to create instance of your bot and specify token.

package main

import (
	"fmt"
	"os"

	"github.com/mymmrac/telego"
)

func main() {
	// Get Bot token from environment variables
	botToken := os.Getenv("TOKEN")

	// Create bot and enable debugging info
	// (more on configuration at /examples/configuration/main.go)
	bot, err := telego.NewBot(botToken, telego.DefaultLogger(true, true))
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	// Call method getMe (https://core.telegram.org/bots/api#getme)
	botUser, err := bot.GetMe()
	if err != nil {
		fmt.Println("Error:", err)
	}

	// Print Bot information
	fmt.Printf("Bot user: %#v\n", botUser)
}

📩 Getting updates

▲ Go Up ▲

In order to receive updates you can use two methods:

  • using long polling (bot.UpdatesViaLongPulling)
  • using webhook (bot.UpdatesViaWebhook)

Let's start from long pulling (easier for local testing):

package main

import (
	"fmt"
	"os"
	"time"

	"github.com/mymmrac/telego"
)

func main() {
	botToken := os.Getenv("TOKEN")

	bot, err := telego.NewBot(botToken, telego.DefaultLogger(true, true))
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	// Optional. Set interval of getting updates (default: 0.5s).
	// If you want to get updates as fast as possible set to 0,
	// but webhook method is recommended for this.
	bot.SetUpdateInterval(time.Second / 2)

	// Get updates channel
	updates, _ := bot.UpdatesViaLongPulling(nil)

	// Stop reviving updates from updates channel
	defer bot.StopLongPulling()

	// Loop through all updates when they came
	for update := range updates {
		fmt.Printf("Update: %#v\n", update)
	}
}

Webhook example (recommended way):

package main

import (
	"fmt"
	"os"

	"github.com/mymmrac/telego"
)

func main() {
	botToken := os.Getenv("TOKEN")

	bot, err := telego.NewBot(botToken, telego.DefaultLogger(true, true))
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	// Set up a webhook on Telegram side
	_ = bot.SetWebhook(&telego.SetWebhookParams{
		URL: "https://example.com/bot" + bot.Token(),
	})

	// Receive information about webhook
	info, _ := bot.GetWebhookInfo()
	fmt.Printf("Webhook Info: %#v\n", info)

	// Get updates channel from webhook.
	// Note: For one bot only one webhook allowed.
	updates, _ := bot.UpdatesViaWebhook("/bot" + bot.Token())

	// Start server for receiving requests from Telegram
	bot.StartListeningForWebhook("localhost:443")

	// Stop reviving updates from updates channel and shutdown webhook server
	defer func() {
		_ = bot.StopWebhook()
	}()

	// Loop through all updates when they came
	for update := range updates {
		fmt.Printf("Update: %#v\n", update)
	}
}

Note: You may wish to use Let's Encrypt in order to generate your free TLS certificate.

🪁 Using Telegram methods

▲ Go Up ▲

All Telegram Bot API methods described in documentation can be used by the library. They have same names and same parameters, parameters represented by struct with name: + Params. If method don't have required parameters nil value can be used as a parameter.

Note: types.go and methods.go was automatically generated from documentation, and it's possible that they have errors or missing parts both in comments and actual code. Fell free to report such things.

package main

import (
	"fmt"
	"os"

	"github.com/mymmrac/telego"
	tu "github.com/mymmrac/telego/telegoutil"
)

func main() {
	botToken := os.Getenv("TOKEN")

	bot, err := telego.NewBot(botToken, telego.DefaultLogger(true, true))
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	// Call method getMe
	botUser, _ := bot.GetMe()
	fmt.Printf("Bot User: %#v\n", botUser)

	updates, _ := bot.UpdatesViaLongPulling(nil)
	defer bot.StopLongPulling()

	for update := range updates {
		if update.Message != nil {
			// Retrieve chat ID
			chatID := update.Message.Chat.ID

			// Call method sendMessage (https://core.telegram.org/bots/api#sendmessage).
			// Sends message to sender with same text (echo bot).
			sentMessage, _ := bot.SendMessage(
				tu.Message(
					tu.ID(chatID),
					update.Message.Text,
				),
			)

			fmt.Printf("Sent Message: %v\n", sentMessage)
		}
	}
}

🧼 Utility methods

▲ Go Up ▲

In Telego even though you have all types and methods available, it's often not so convenient to use them directly. To solve this issues telegoutil package was created. It contains utility-helper function that will make your life a bit easier.

I suggest including it with alias to get cleaner code:

import tu "github.com/mymmrac/telego/telegoutil"

Package contains couple methods for creating send parameters with all required parameters like:

  • Message(chatID, text) => SendMessageParams
  • Photo(chatID, photoFile) => SendPhotoParams
  • Location(chatID, latitude, longitude) => SendLocationParams
  • ...

Or other useful methods like:

  • ID(intID) => ChatID
  • File(namedReader) => InputFile
  • ...

Utils related to methods can be found in telegoutil/methods, for types in telegoutil/types, for handlers in telegoutil/handler, for api in telegoutil/api.

Note: If you think that something can be added to telegoutil package fill free to create an issue or pull request with desired changes.

🦾 Helper With... methods

▲ Go Up ▲

Creating method parameters is sometimes bulky and not convenient, so you can use with methods in combination with utility methods.

Here is a simple example of creating a message with a keyboard that has 4 buttons with different parameters.

<- `with` method ), tu.KeyboardRow( // Row 2 tu.KeyboardButton("Contact").WithRequestContact(), // Column 1, <- `with` method tu.KeyboardButton("Location").WithRequestLocation(), // Column 2, <- `with` method ), ).WithResizeKeyboard().WithInputFieldPlaceholder("Select something") // <- multiple `with` methods // Creating message msg := tu.Message( tu.ID(123), "Hello World", ).WithReplyMarkup(keyboard).WithProtectContent() // <- multiple `with` method bot.SendMessage(msg) }">
package main

import (
	"github.com/mymmrac/telego"
	tu "github.com/mymmrac/telego/telegoutil"
)

func main() {
	// ... initializing bot

	// Creating keyboard
	keyboard := tu.Keyboard(
		tu.KeyboardRow( // Row 1
			tu.KeyboardButton("Button"), // Column 1
			tu.KeyboardButton("Poll Regular"). // Column 2
				WithRequestPoll(tu.PollTypeRegular()), // <- `with` method
		),
		tu.KeyboardRow( // Row 2
			tu.KeyboardButton("Contact").WithRequestContact(),   // Column 1, <- `with` method 
			tu.KeyboardButton("Location").WithRequestLocation(), // Column 2, <- `with` method 
		),
	).WithResizeKeyboard().WithInputFieldPlaceholder("Select something") // <- multiple `with` methods 

	// Creating message
	msg := tu.Message(
		tu.ID(123),
		"Hello World",
	).WithReplyMarkup(keyboard).WithProtectContent() // <- multiple `with` method 

	bot.SendMessage(msg)
}

Those methods allow you to modify values without directly accessing them, also as you saw with methods can be staked one to another in order to update multiple values.

⛅️ Bot handlers

▲ Go Up ▲

Processing updates just in for loop is not the most pleasing thing to do, so Telego provides net/http like handlers, but instead of the path, you provide predicates.

One update will only match to the first handler whose predicates are satisfied, predicates checked in order of handler registration (it's useful to first specify most specific predicates and then more general).

Also, all handlers (but not their predicates) are processed in parallel.

I suggest including it with alias to get cleaner code:

import th "github.com/mymmrac/telego/telegohandler"

Here is example of using handlers with long pulling updates. You can see full list of available predicates in telegohandler/pradicates, or define your own.

package main

import (
	"fmt"
	"os"

	"github.com/mymmrac/telego"
	th "github.com/mymmrac/telego/telegohandler"
	tu "github.com/mymmrac/telego/telegoutil"
)

func main() {
	botToken := os.Getenv("TOKEN")

	bot, err := telego.NewBot(botToken, telego.WithDefaultLogger(true, true))
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	// Get updates channel
	updates, _ := bot.UpdatesViaLongPulling(nil)
	defer bot.StopLongPulling()

	// Create bot handler and specify from where to get updates
	bh := th.NewBotHandler(bot, updates)

	// Register new handler with match on command `/start`
	bh.Handle(func(bot *telego.Bot, update telego.Update) {
		// Send message
		_, _ = bot.SendMessage(tu.Message(
			tu.ID(update.Message.Chat.ID),
			fmt.Sprintf("Hello %s!", update.Message.From.FirstName),
		))
	}, th.CommandEqual("start"))

	// Register new handler with match on any command
	// Handlers will match only once and in order of registration, so this handler will be called on any command except
	// `/start` command
	bh.Handle(func(bot *telego.Bot, update telego.Update) {
		// Send message
		_, _ = bot.SendMessage(tu.Message(
			tu.ID(update.Message.Chat.ID),
			"Unknown command, use /start",
		))
	}, th.AnyCommand())

	// Start handling updates
	bh.Start()

	// Stop handling updates
	defer bh.Stop()
}

🎨 Contribution

Contribution guidelines listed here.

🔐 License

Telego is distributed under MIT licence.

Owner
Artem Yadelskyi
Developer of Telego (Telegram Bot API library for Golang), part of Gopher Team
Artem Yadelskyi
Comments
  • ⭐️Run 2 and more bots on the same server

    ⭐️Run 2 and more bots on the same server

    ⭐️ Feature description

    Run 2 bots on the same server with the single golang binary

    🌈 Your view

    Webhook mode Now we can run only 1 bot. To run 2 and more bot we need polling mode or change ports. When we try to run second bot - we get error (port busy) How can we use one fast http server for 2 and more bots?

    🧐 Code example

    No response

  • ⭐️ telegohandler.HandlerWrapper

    ⭐️ telegohandler.HandlerWrapper

    ⭐️ Feature description

    It can accept multiple Handlers to return a Handler to simulate a gin-like route capability.

    This will provide more power over the original telego handler. Examples include middleware (necessary for authenticated bots), error handling, and more complex logic controls.

    If you like the idea, I can submit a PR.

    🌈 Your view

    You can see the code example.

    🧐 Code example

    package middleware
    
    import (
    	"context"
    	"github.com/mymmrac/telego"
    	"github.com/mymmrac/telego/telegohandler"
    	"github.com/mymmrac/telego/telegoutil"
    )
    
    type Ctx struct {
    	stack        []WrapperHandler
    	context      context.Context
    	indexHandler int
    	update       telego.Update
    	bot          *telego.Bot
    }
    
    func (c *Ctx) Next() error {
    	c.indexHandler++
    	if c.indexHandler == len(c.stack) {
    		return nil
    	}
    	h := c.stack[c.indexHandler]
    	return h(c)
    }
    
    func (c *Ctx) SendMessage(text string) error {
    	chatID := telegoutil.ID(c.update.Message.Chat.ID)
    	_, err := c.bot.SendMessage(telegoutil.Message(
    		chatID,
    		text))
    	return err
    }
    
    type WrapperHandlerBuilder struct {
    	ErrorHandler WrapperErrorHandler
    	stack        []WrapperHandler
    }
    
    func defaultErrorHandler(ctx *Ctx, err error) {
    	ctx.SendMessage(err.Error())
    }
    
    func (w *WrapperHandlerBuilder) Add(h ...WrapperHandler) {
    	w.stack = append(w.stack, h...)
    }
    
    func (w *WrapperHandlerBuilder) Build() telegohandler.Handler {
    	return func(bot *telego.Bot, update telego.Update) {
    		c := &Ctx{
    			context:      context.Background(),
    			indexHandler: 0,
    			update:       update,
    			bot:          bot,
    		}
    		if len(w.stack) == 0 {
    			return
    		}
    		h := w.stack[0]
    		if err := h(c); err != nil {
    			w.ErrorHandler(c, err)
    		}
    	}
    }
    
    type WrapperHandler func(ctx *Ctx) error
    type WrapperErrorHandler func(ctx *Ctx, err error)
    
    func NewWrapperHandlerBuilder() *WrapperHandlerBuilder {
    	return &WrapperHandlerBuilder{
    		ErrorHandler: defaultErrorHandler,
    	}
    }
    
    
  • `Invalid chat id` response from telegram when using Username as ChatID and sending a Photo.

    `Invalid chat id` response from telegram when using Username as ChatID and sending a Photo.

    params := &telego.SendPhotoParams{
    		ChatID:                   telego.ChatID{ Username: "@channel_name" },
    		Photo:                    telego.InputFile{ File: f},
    		Caption:                  "https://test.ru/test_url",
    	}
    _, err = g.bot.SendPhoto(params)
    

    The reason is that in the resulting request ChatID contains "extra" double quotes like "@channel_name"

  • Bump golang.org/x/text from 0.4.0 to 0.5.0

    Bump golang.org/x/text from 0.4.0 to 0.5.0

    Bumps golang.org/x/text from 0.4.0 to 0.5.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/goccy/go-json from 0.9.11 to 0.10.0

    Bump github.com/goccy/go-json from 0.9.11 to 0.10.0

    Bumps github.com/goccy/go-json from 0.9.11 to 0.10.0.

    Release notes

    Sourced from github.com/goccy/go-json's releases.

    0.10.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/goccy/go-json/compare/v0.9.11...v0.10.0

    Changelog

    Sourced from github.com/goccy/go-json's changelog.

    v0.10.0 - 2022/11/29

    New features

    • Support JSON Path ( #250 )

    Fix bugs

    • Fix marshaler for map's key ( #409 )
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/valyala/fasthttp from 1.42.0 to 1.43.0

    Bump github.com/valyala/fasthttp from 1.42.0 to 1.43.0

    Bumps github.com/valyala/fasthttp from 1.42.0 to 1.43.0.

    Release notes

    Sourced from github.com/valyala/fasthttp's releases.

    v1.43.0

    • dbf457e Revert "feat: support mulit/range (#1398)" (#1446) (Erik Dubbelboer)
    • c50de95 client.go fix addMissingPort() (#1444) (Sergey Ponomarev)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/valyala/fasthttp from 1.41.0 to 1.42.0

    Bump github.com/valyala/fasthttp from 1.41.0 to 1.42.0

    Bumps github.com/valyala/fasthttp from 1.41.0 to 1.42.0.

    Release notes

    Sourced from github.com/valyala/fasthttp's releases.

    v1.42.0

    • 4995135 feat: add ShutdownWithContext (#1383) (kinggo)
    • 7b3bf58 style: modify typo and remove repeated type conversions (#1437) (kinggo)
    • 8f43443 Wait for the response of pipelineWork in background and return it to pool (#1436) (Andy Pan)
    • c367454 Fix some potential pool leaks (#1433) (Andy Pan)
    • b32a3dd Use time.Until(deadline) instead of -time.Since(deadline) (#1434) (Andy Pan)
    • 8a60232 Assert with *net.TCPConn instead of *net.TCPListener in acceptConn() for TCP sockets (#1432) (Andy Pan)
    • c57a2ce Make sure nothing is nil in tmp slice (#1423) (hs son)
    • f095481 Request.SetTimeout (#1415) (brian-armstrong-discord)
    • c88dd5d fix form empty field error when used with pipe (#1417) (nick9822)
    • a468a7d feat: support mulit/range (#1398) (byene0923)
    • 3963a79 feat: add PeekKeys and PeekTrailerKeys (#1405) (kinggo)
    • eca86de fix: (#1410) (byene0923)
    • e214137 fix: ignore body should not set content-length of streaming (#1406) (byene0923)
    Commits
    • 4995135 feat: add ShutdownWithContext (#1383)
    • 7b3bf58 style: modify typo and remove repeated type conversions (#1437)
    • 8f43443 Wait for the response of pipelineWork in background and return it to pool (#1...
    • c367454 Fix some potential pool leaks (#1433)
    • b32a3dd Use time.Until(deadline) instead of -time.Since(deadline) (#1434)
    • 8a60232 Assert with *net.TCPConn instead of *net.TCPListener in acceptConn() for TCP ...
    • c57a2ce Make sure nothing is nil in tmp slice (#1423)
    • f095481 Request.SetTimeout (#1415)
    • c88dd5d fix form empty field error when used with pipe (#1417)
    • a468a7d feat: support mulit/range (#1398)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/fasthttp/router from 1.4.13 to 1.4.14

    Bump github.com/fasthttp/router from 1.4.13 to 1.4.14

    Bumps github.com/fasthttp/router from 1.4.13 to 1.4.14.

    Release notes

    Sourced from github.com/fasthttp/router's releases.

    v1.4.14

    • 405cb38 feat: upgrade dependencies (Sergio VS)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Fixed typo in Makefile

    Fixed typo in Makefile

    :speech_balloon: Description

    Changed bit to bin in Makefile.

    :monocle_face: Type of change

    • [x] Documentation update (changes in comments, .md files or other docs)
  • Bump github.com/fasthttp/router from 1.4.12 to 1.4.13

    Bump github.com/fasthttp/router from 1.4.12 to 1.4.13

    Bumps github.com/fasthttp/router from 1.4.12 to 1.4.13.

    Release notes

    Sourced from github.com/fasthttp/router's releases.

    v1.4.13

    • fec4124 chore: deprecated Go 1.15 (Sergio VS)
    • 71c8a0c feat: upgrade fasthttp to v1.41.0 (Sergio VS)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/valyala/fasthttp from 1.40.0 to 1.41.0

    Bump github.com/valyala/fasthttp from 1.40.0 to 1.41.0

    Bumps github.com/valyala/fasthttp from 1.40.0 to 1.41.0.

    Release notes

    Sourced from github.com/valyala/fasthttp's releases.

    v1.41.0

    • 128e9b3 optimize: adjust the behavior of PeekAll based on VisitAll (#1403) (kinggo)
    • 2c8ce3b feat: add header.PeekAll (#1394) (kinggo)
    • d404f2d make RequestCtx's userdata accept keys that are of type: interface{} (#1387) (pj)
    • bcf7e8e test: merge test in adaptor_test.go (#1381) (kinggo)
    • 31fdc79 resolve CVE-2022-27664 (#1377) (Craig O'Donnell)
    • 40eec0b byte to string unsafe conversion in fasthttpadaptor ConvertRequest method (#1375) (Emre Savcı)
    • a696949 Deprecate Go 1.15 (#1379) (Aoang)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Typo on LongPolling.

    Typo on LongPolling.

    💬 Telego version

    v0.18.1

    👾 Issue description

    It's not a bug actually, but it seems like that there is a massive typo on LongPolling which is written as LongPulling.

    I thought that I'm wrong and it's actually LongPulling, but as I checked again and even visited the official docs, it's actually LongPolling

    I wanted to know, was this on purpose or it's a typo or...?

    ⚡️ Expected behavior

    No response

    🧐 Code example

    No response

  • ⭐️ Refactor `UpdatesViaWebhook` to be server agnostic

    ⭐️ Refactor `UpdatesViaWebhook` to be server agnostic

    ⭐️ Feature description

    UpdatesViaWebhook should really be server agnostic to achieve ease of creating multiple bots from one server and use with custom servers with already existing functionality.

    This is definitely a breaking change.

    Modify to accept custom options:

    • StartListeningForWebhook

    Deprecate after changes:

    • StartListeningForWebhookTLS
    • StartListeningForWebhookTLSEmbed
    • StartListeningForWebhookUNIX

    🌈 Your view

    Create an interface for Server with default implementation of net/http and fasthttp servers.

    🧐 Code example

    No response

  • ⭐️ Docs (mymmrac.github.io/telego-docs)

    ⭐️ Docs (mymmrac.github.io/telego-docs)

  • ⭐️ Update CI flow for PR

    ⭐️ Update CI flow for PR

    ⭐️ Feature description

    Make two different flows for master and PRs or fix SonarCloud not being able to run

    🌈 Your view

    No response

    🧐 Code example

    No response

Pro-bot - A telegram bot to play around with the community telegram channels

pro-bot ?? Pro Bot A Telegram Bot to Play Around With The Community Telegram Cha

Jan 24, 2022
Full-native go implementation of Telegram API
Full-native go implementation of Telegram API

MTProto Full-native implementation of MTProto protocol on Golang! english русский 简体中文 Features Full native implementation All code, from sending requ

Jan 1, 2023
A bot based on Telegram Bot API written in Golang allows users to download public Instagram photos, videos, and albums without receiving the user's credentials.

InstagramRobot InstagramRobot is a bot based on Telegram Bot API written in Golang that allows users to download public Instagram photos, videos, and

Dec 16, 2021
Bot - Telegram Music Bot in Go

Telegram Music Bot in Go An example bot using gotgcalls. Setup Install the serve

Jun 28, 2022
Library for working with golang telegram client + bot based on tdlib. This library was taken from the user Arman92 and changed for the current version of tdlib.

go-tdlib Golang Telegram TdLib JSON bindings Install To install, you need to run inside a docker container (it is given below) go get -u github.com/ka

Dec 2, 2022
Bot-template - A simple bot template for creating a bot which includes a config, postgresql database

bot-template This is a simple bot template for creating a bot which includes a c

Sep 9, 2022
Go library for Telegram Bot API
Go library for Telegram Bot API

tbot - Telegram Bot Server Features Full Telegram Bot API 4.7 support Zero dependency Type-safe API client with functional options Capture messages by

Nov 30, 2022
Flexible message router add-on for go-telegram-bot-api library.
Flexible message router add-on for go-telegram-bot-api library.

telemux Flexible message router add-on for go-telegram-bot-api library. Table of contents Motivation Features Minimal example Documentation Changelog

Oct 24, 2022
Telegram bot written in Golang using gotgbot library

go_tgbot Telegram bot written in Golang using gotgbot library. How to run go get -u github.com/itsLuuke/go_tgbot rename sample.env to .env and fill in

Nov 4, 2022
Golang telegram bot API wrapper, session-based router and middleware

go-tgbot Pure Golang telegram bot API wrapper generated from swagger definition, session-based routing and middlewares. Usage benefits No need to lear

Nov 16, 2022
Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

Jan 6, 2023
Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

Nov 18, 2021
The serverless OTP telegram service use telegram as OTP service, and send OTP through webhook

Setup OTP First thing, you need prepare API(webhook) with POST method, the payload format as below { "first_name": "Nolan", "last_name": "Nguyen",

Jul 24, 2022
Our library to interact with a telegram bot.

gotelegrambot Here you can find our library for telegram bot's. We develop the API endpoints according to our demand and need. You are welcome to help

Dec 18, 2021
A Telegram bot hook for Logrus logging library in Go

logrus2telegram logrus2telegram is a Telegram bot hook for Logrus logging librar

Nov 15, 2022
Client lib for Telegram bot api

Micha Client lib for Telegram bot api. Supports Bot API v2.3.1 (of 4th Dec 2016). Simple echo bot example: package main import ( "log" "git

Nov 10, 2022
Bot that polls activity API for Github organisation and pushes updates to Telegram.

git-telegram-bot Telegram bot for notifying org events Requirements (for building) Go version 1.16.x Setup If you don't have a telegram bot token yet,

Apr 8, 2022
WIP Telegram Bot API server in Go

botapi The telegram-bot-api, but in go. WIP. Reference: https://core.telegram.org/bots/api Reference implementation: https://github.com/tdlib/telegram

Jan 2, 2023
UcodeQrTelebot ver2 - Easy way to get QR and U-code using Utopia API in telegram bot
UcodeQrTelebot ver2 - Easy way to get QR and U-code using Utopia API in telegram bot

UcodeQrTelebot Easy way to get QR and U-code using Utopia API in telegram bot Us

Dec 30, 2021