Golang bindings for the Telegram Bot API

Overview

Golang bindings for the Telegram Bot API

GoDoc Travis

All methods are fairly self explanatory, and reading the godoc page should explain everything. If something isn't clear, open an issue or submit a pull request.

The scope of this project is just to provide a wrapper around the API without any additional features. There are other projects for creating something with plugins and command handlers without having to design all that yourself.

Join the development group if you want to ask questions or discuss development.

Example

First, ensure the library is installed and up to date by running go get -u github.com/go-telegram-bot-api/telegram-bot-api.

This is a very simple bot that just displays any gotten updates, then replies it to that chat.

package main

import (
	"log"

	"github.com/go-telegram-bot-api/telegram-bot-api"
)

func main() {
	bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken")
	if err != nil {
		log.Panic(err)
	}

	bot.Debug = true

	log.Printf("Authorized on account %s", bot.Self.UserName)

	u := tgbotapi.NewUpdate(0)
	u.Timeout = 60

	updates, err := bot.GetUpdatesChan(u)

	for update := range updates {
		if update.Message == nil { // ignore any non-Message Updates
			continue
		}

		log.Printf("[%s] %s", update.Message.From.UserName, update.Message.Text)

		msg := tgbotapi.NewMessage(update.Message.Chat.ID, update.Message.Text)
		msg.ReplyToMessageID = update.Message.MessageID

		bot.Send(msg)
	}
}

There are more examples on the wiki with detailed information on how to do many different kinds of things. It's a great place to get started on using keyboards, commands, or other kinds of reply markup.

If you need to use webhooks (if you wish to run on Google App Engine), you may use a slightly different method.

package main

import (
	"log"
	"net/http"

	"github.com/go-telegram-bot-api/telegram-bot-api"
)

func main() {
	bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken")
	if err != nil {
		log.Fatal(err)
	}

	bot.Debug = true

	log.Printf("Authorized on account %s", bot.Self.UserName)

	_, err = bot.SetWebhook(tgbotapi.NewWebhookWithCert("https://www.google.com:8443/"+bot.Token, "cert.pem"))
	if err != nil {
		log.Fatal(err)
	}
	info, err := bot.GetWebhookInfo()
	if err != nil {
		log.Fatal(err)
	}
	if info.LastErrorDate != 0 {
		log.Printf("Telegram callback failed: %s", info.LastErrorMessage)
	}
	updates := bot.ListenForWebhook("/" + bot.Token)
	go http.ListenAndServeTLS("0.0.0.0:8443", "cert.pem", "key.pem", nil)

	for update := range updates {
		log.Printf("%+v\n", update)
	}
}

If you need, you may generate a self signed certficate, as this requires HTTPS / TLS. The above example tells Telegram that this is your certificate and that it should be trusted, even though it is not properly signed.

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3560 -subj "//O=Org\CN=Test" -nodes

Now that Let's Encrypt is available, you may wish to generate your free TLS certificate there.

Comments
  • Multi-thread safe?

    Multi-thread safe?

    Just wondering if I need to protect the bot object with a mutex when calling bot.Send() from multiple go routines. I don't think I do, but just want to be sure.

    opened by utdrmac 12
  • cannot access some methods when using with go.mod

    cannot access some methods when using with go.mod

    It works fine when not using go.mod

    my go.mod

    module github.com/phanirithvij/stickerbot
    
    go 1.13
    
    require (
    	github.com/cavaliercoder/grab v2.0.0+incompatible
    	github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
    	github.com/spf13/viper v1.6.3
    	github.com/technoweenie/multipartstreamer v1.0.1 // indirect
    )
    

    my go.sum file

    //...
    github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
    github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
    

    Code:

    //...
    config := tgbotapi.GetStickerSetConfig{Name: stickerSet}
    data, err := bot.GetStickerSet(config)
    //...
    

    Error:

    # command-line-arguments
    .\bot.go:76:14: undefined: tgbotapi.GetStickerSetConfig
    .\bot.go:77:20: bot.GetStickerSet undefined (type *tgbotapi.BotAPI has no field or method GetStickerSet)
    
    opened by phanirithvij 10
  • BUTTON_TYPE_INVALID

    BUTTON_TYPE_INVALID

    Bad Request: BUTTON_TYPE_INVALID if I try remove InlineKeyboard in message by this code:

    edit := tgbotapi.NewEditMessageReplyMarkup(
        callback.Message.Chat.ID,
        callback.Message.MessageID,
        tgbotapi.InlineKeyboardMarkup{},
    )
    bot.Send(edit)
    

    P.S.: Also, as and with this variant:

    var markup tgbotapi.InlineKeyboardMarkup
    edit := tgbotapi.NewEditMessageText(
        callback.Message.Chat.ID,
        callback.Message.MessageID,
        "sample text",
    )
    edit.ReplyMarkup = &markup
    bot.Send(edit)
    
    opened by toby3d 10
  • Panic when sending Photo by URL

    Panic when sending Photo by URL

    Trying to send a Photo by URL results in nil pointer dereference

    This is the panic:

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x476208]
    
    goroutine 52 [running]:
    panic(0x6224a0, 0xc42000c0d0)
            /usr/lib/go/src/runtime/panic.go:500 +0x1a1
    io.(*multiReader).Read(0xc42023c1a0, 0xc4204572e7, 0x44, 0xd19, 0x1cc, 0x0, 0x0)
            /usr/lib/go/src/io/multi.go:20 +0x98
    io/ioutil.(*nopCloser).Read(0xc42022a270, 0xc4204572e7, 0x44, 0xd19, 0x1cc, 0x0, 0x0)
            <autogenerated>:4 +0x6b
    io.(*LimitedReader).Read(0xc420376640, 0xc4204572e7, 0xd19, 0xd19, 0x1cc, 0x0, 0x0)
            /usr/lib/go/src/io/io.go:436 +0x6c
    bufio.(*Writer).ReadFrom(0xc420322f80, 0x75f9e0, 0xc420376640, 0xc4200fcbb8, 0x1, 0x18)
            /usr/lib/go/src/bufio/bufio.go:693 +0xcc
    io.copyBuffer(0x75f660, 0xc420322f80, 0x75f9e0, 0xc420376640, 0x0, 0x0, 0x0, 0x631bc0, 0x1, 0xc420376640)
            /usr/lib/go/src/io/io.go:384 +0x323
    io.Copy(0x75f660, 0xc420322f80, 0x75f9e0, 0xc420376640, 0xf, 0xc420379100, 0x581d02)
            /usr/lib/go/src/io/io.go:360 +0x68
    net/http.(*transferWriter).WriteBody(0xc4202fa7e0, 0x75f660, 0xc420322f80, 0x2, 0x2)
            /usr/lib/go/src/net/http/transfer.go:227 +0x677
    net/http.(*Request).write(0xc4200c01e0, 0x75f660, 0xc420322f80, 0x0, 0xc420365890, 0x0, 0x0, 0x0)
            /usr/lib/go/src/net/http/request.go:565 +0x778
    net/http.(*persistConn).writeLoop(0xc420474300)
            /usr/lib/go/src/net/http/transport.go:1649 +0x1ac
    created by net/http.(*Transport).dialConn
            /usr/lib/go/src/net/http/transport.go:1063 +0x50e
    exit status 2
    

    This is my code:

    package main
    
    import (
            "log"
            "github.com/go-telegram-bot-api/telegram-bot-api"
            "net/url"
    )
    
    func main() {
            bot, err := tgbotapi.NewBotAPI("pls enter some token here")
            if err != nil {
                    log.Panic(err)
            }
            bot.Debug = true
            log.Printf("Authorized on account %s", bot.Self.UserName)
    
            u := tgbotapi.NewUpdate(0)
            u.Timeout = 60
            updates, err := bot.GetUpdatesChan(u)
    
            url_ptr, _ := url.Parse("https://assets-cdn.github.com/images/modules/site/home-ill-platform.png")
            url := *url_ptr
    
            for update := range updates {
                    if update.Message == nil {
                            continue
                    }
                    log.Printf("[%s] %s", update.Message.From.UserName, update.Message.Text)
                    msg := tgbotapi.NewPhotoUpload(update.Message.Chat.ID, url)
                    bot.Send(msg);
            }
    }
    

    The panic is caused by this line: https://github.com/go-telegram-bot-api/telegram-bot-api/blob/99170e2de436c1be90d2ef23dcf533b55a973e56/bot.go#L171

    The panic only happens when sending a Photo via URL, if NewPhotoUpload is called with file path, no panic happens and the Photo is sent correctly.

    question 
    opened by teamalpha5441 10
  • Provide users with more customization when creating a new bot.

    Provide users with more customization when creating a new bot.

    User are now able to create a bot with debug enabled by default.

    The debug part is use full when NewBotAPI() is failing with the message

    [email protected]    | 2018/11/12 12:15:38 created msg
    [email protected]    | 2018/11/12 12:15:38 getting bot
    [email protected]    | 2018/11/12 12:15:38 error is about to happen
    [email protected]    | 2018/11/12 12:15:38 Not Found (this one 🤷🏾‍♂️)
    

    By being able to enale debug when creating the bot user are able to debug the following code:

    		b, err := tgbotapi.NewBotAPI(os.Getenv("TELEGRAM_BOT_TOKEN"))
    
    		if err != nil {
    			log.Print("error is about to happen")
    			log.Fatal(err)
    		}
    
    opened by OGKevin 8
  • answering inline query

    answering inline query

    I think that we need an example of answering inline-query, I'm having a little problem making one myself, so hopefully the following code will demonstrate a question/example to be used in README.md

    package main
    
    import (
        "log"
    
        "gopkg.in/telegram-bot-api.v1"
    )
    
    func main() {
        bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken")
        if err != nil {
            log.Panic(err)
        }
    
        log.Printf("Authorized on account %s", bot.Self.UserName)
    
        u := tgbotapi.NewUpdate(0)
        u.Timeout = 60
    
        updates, err := bot.GetUpdatesChan(u)
    
        for update := range updates {
            if update.InlineQuery.Query == "" {
                continue
            }
    
            answer := tgbotapi.InlineQueryResultArticle{
                InlineQueryResult: tgbotapi.InlineQueryResult{ // ??
                    Type: "article",
                    ID:   update.InlineQuery.ID,
                },
    
                Title:       "Echo",
                MessageText: update.InlineQuery.Query,
            }
    
            inlineConf := tgbotapi.InlineConfig{
                InlineQueryID: update.InlineQuery.Query,
                Results:       []tgbotapi.InlineQueryResult{answer.InlineQueryResult}, // ??
            }
    
            if _, err := bot.AnswerInlineQuery(inlineConf); err != nil {
                log.Println(err)
            }
    
        }
    }
    

    I'm not sure how to deal with InlineQueryResult, this example will hit this error: [Error]: Bad request: Can't find field "message_text"

    opened by pyed 8
  • Hi, there not really PR, but new vision of tgbotapi with new API

    Hi, there not really PR, but new vision of tgbotapi with new API

    Many refactorings and DRYing, all Send* functions replaces with one Send(), Some other small changes. Tests added, 85% coverage. Everything works. Travis added.

    Please, check my code. I know, that public API is changed, but it's really useful. It will be great if it possible to merge my code to upstream, but i can rename project and develop it as my own.

    Package Syfaro/telegram-bot-api in my fork changed to zhulik/telegram-bot-api. I will change it back if you will merge my code.

    Thanks!

    ps: I want to develop some Bot framework based on it, with commands support, sessions, middlewares and so on

    opened by zhulik 8
  • Answering inline query with a sticker

    Answering inline query with a sticker

    I want to use InlineQueryResultCachedSticker/NewInlineQueryResultCachedSticker in my project. As far as i understand, it is not available in current release. So, i'd like to know, if there is any way to use it now or when it will be available.

    opened by yshym 7
  • How to use payments

    How to use payments

    Couldn't quite figure out how to make payments with your library. I found the AnswerPreCheckoutQuery and AnswerShippingQuery methods, however, how do I sendInvoice? There's Pay field in InlineKeyboard button, but I don't think it does anything. Where do I enter my payment provider token and other info?

    question 
    opened by qoops-1 7
  • implement a feature that allows stopping the update loop of the bot

    implement a feature that allows stopping the update loop of the bot

    This is a PR following the improvement proposal I've posted in issue #84

    The code in the PR implements an option to stop the update loop that is generated on a call to GetUpdatesChan

    opened by sandler31 7
  • More flexible logging options

    More flexible logging options

    At the moment this library does not allow a developer to replace the golang default log package to capture logs to redirect to say syslog as is common with services.

    This is mainly apparent in the UpdatesChan goroutine when an error occurs during the poll.

    opened by nvx 7
  • why remove KickChatMember function from BotAPI in v5?

    why remove KickChatMember function from BotAPI in v5?

    v5 documentation: https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api/v5#BotAPI v4.6.4 documentation: https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api#BotAPI.KickChatMember

    why remove KickChatMember function from BotAPI in v5?

    opened by jenningszheng 0
  • Versioning and releases

    Versioning and releases

    Hi, The last version available by default from go get is 5.5.1, which naturally does not include any changes made to the codebase since 21 December 2021. It would be great if any semantic versioning would be enabled for the merges to the master branch. There's no need to follow the official telegram API versioning, but it would make life easier for everyone.

    If you don't want to play around with manual version calculation, feel free to use my github action, which you can quickly hook up to the existing workflow - https://github.com/lukaszraczylo/semver-generator - or I can even help you with it if necessary.

    opened by lukaszraczylo 0
  • WebHooks not working 😠

    WebHooks not working 😠

    When I use

    webhook, err := tgbotapi.NewWebhook(host + ":" + port + "/" + bot.Token)
    updates := bot.ListenForWebhook("/" + bot.Token)
    

    (took it from docs) it doesn't work at all, (tested locally with ngrok and localtunnel, ngrok doesn't even get anything) , but when I use this (currently on heroku):

    webhook, err := tgbotapi.NewWebhook(host + bot.Token)
    updates := bot.ListenForWebhook("/" + bot.Token)
    

    it works just fine.

    Is it a bug, or did I miss something in the docs?

    opened by hardskulls 0
  • Fix EscapeText for MarkdownV2.

    Fix EscapeText for MarkdownV2.

    This pull request is pretty straight forward...

    Telegram documentation says:

    Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.

    Source: https://core.telegram.org/bots/api#markdownv2-style

    So here goes a simple sample program to simulate the bug:

    package main
    
    import (
    	"fmt"
    
    	tg "github.com/go-telegram-bot-api/telegram-bot-api/v5"
    )
    
    func main() {
    	fmt.Println(tg.EscapeText(tg.ModeMarkdownV2, `a\b`))
    	fmt.Println(tg.EscapeText(tg.ModeMarkdownV2, `a\(b)c`))
    }
    

    Before the fix:

    a\b
    a\\(b\)c
    

    After the fix:

    a\\b
    a\\\(b\)c
    

    In the first example: the message will be send like "ab" (the slash will disappear)

    In the second example: the message will not be sent, it will error out something like this: Bad Request: can't parse entities: Character '(' is reserved and must be escaped with the preceding '\'

    It's a small fix, but an important one.

    []'s

    opened by navossoc 0
Releases(v5.5.1)
  • v5.5.1(Dec 13, 2021)

    What's Changed

    • 🚑 Fix ChatJoinRequest.From json tag by @zigmund in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/500

    New Contributors

    • @zigmund made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/500

    Full Changelog: https://github.com/go-telegram-bot-api/telegram-bot-api/compare/v5.5.0...v5.5.1

    Source code(tar.gz)
    Source code(zip)
  • v5.5.0(Dec 8, 2021)

    • :sparkles: Add support for Bot API 5.5 https://github.com/go-telegram-bot-api/telegram-bot-api/commit/3f07c5f67644dfc8a9c37210de2b95cfdb060515
    • :ambulance: Fix a bug in ListenForWebhook where the channel would immediately be closed https://github.com/go-telegram-bot-api/telegram-bot-api/commit/fde58e56ae1e2629ee6b4a77a7feb0ddf38340ee
    • :pencil2: Rename KickChatMember to BanChatMember as part of missed Bot API 5.3 change https://github.com/go-telegram-bot-api/telegram-bot-api/commit/f2ef2729ab6c83b860cde5326e70b3c143b00ec3
    Source code(tar.gz)
    Source code(zip)
  • v5.4.0(Dec 4, 2021)

    See the site for information about upgrading from v4

    What's Changed

    • Bot API 4.6: Polls 2.0, misc. changes by @tjhorner in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/302
    • Resolve develop conflicts by @zhuharev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/307
    • Add FileUniqueID to ChatAnimation by @AlessandroPomponio in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/305
    • Create helper function WriteToHTTPResponse by @CNA-Bld in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/312
    • Added omitempty tag for clean JSON marshaling by @biodranik in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/336
    • fix add sticker to stickerset uploads by url and fileId by @overplumbum in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/210
    • Uploading a new photo to a channel functionality added. by @zergon321 in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/261
    • Cleanup bot test by @ErrorBoi in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/321
    • Add API type docks pack one by @ilyakaznacheev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/383
    • Add API type docks pack two by @ilyakaznacheev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/384
    • Add API type docks pack three by @ilyakaznacheev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/385
    • Attempt to use GitHub Actions by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/359
    • Escape Telegram formatting symbols by @ErikPelli in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/388
    • Updates for Bot API 5.0 and 5.1 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/392
    • Add support for uploading multiple files by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/356
    • Change UserID to int64 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/431
    • Handle error in NewWebhook and NewWebhookWithCert by @Eivel in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/375
    • Add helper for InlineKeyboardButtonLoginURL by @antsupovsa in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/267
    • Updates for Bot API 5.2, other small fixes by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/443
    • Add improved documentation by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/434
    • Updates for Bot API 5.3 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/460
    • Updates for Bot API 5.4 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/486
    • Create interface for file data by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/469
    • Deduplicate code, improve response accuracy. by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/202
    • [FEAT]: Add SentFrom method to Update type by @quenbyako in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/416
    • Fix bug with update channel closing, add ListenForWebhookRespReqFormat method by @farit2000 in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/395
    • Fix typos and grammar issues in comments by @alexandear in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/483
    • Fix comment format for functions and constants by @alexandear in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/487

    New Contributors

    • @AlessandroPomponio made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/305
    • @CNA-Bld made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/312
    • @biodranik made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/336
    • @zergon321 made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/261
    • @ErrorBoi made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/321
    • @ErikPelli made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/388
    • @Eivel made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/375
    • @antsupovsa made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/267
    • @quenbyako made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/416
    • @farit2000 made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/395
    • @alexandear made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/483
    Source code(tar.gz)
    Source code(zip)
  • v5.4.0-beta.0(Nov 8, 2021)

    What's Changed

    • Bot API 4.6: Polls 2.0, misc. changes by @tjhorner in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/302
    • Resolve develop conflicts by @zhuharev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/307
    • Add FileUniqueID to ChatAnimation by @AlessandroPomponio in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/305
    • Create helper function WriteToHTTPResponse by @CNA-Bld in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/312
    • Added omitempty tag for clean JSON marshaling by @biodranik in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/336
    • fix add sticker to stickerset uploads by url and fileId by @overplumbum in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/210
    • Uploading a new photo to a channel functionality added. by @zergon321 in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/261
    • Cleanup bot test by @ErrorBoi in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/321
    • Add API type docks pack one by @ilyakaznacheev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/383
    • Add API type docks pack two by @ilyakaznacheev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/384
    • Add API type docks pack three by @ilyakaznacheev in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/385
    • Attempt to use GitHub Actions by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/359
    • Escape Telegram formatting symbols by @ErikPelli in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/388
    • Updates for Bot API 5.0 and 5.1 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/392
    • Add support for uploading multiple files by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/356
    • Change UserID to int64 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/431
    • Handle error in NewWebhook and NewWebhookWithCert by @Eivel in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/375
    • Add helper for InlineKeyboardButtonLoginURL by @antsupovsa in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/267
    • Updates for Bot API 5.2, other small fixes by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/443
    • Add improved documentation by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/434
    • Updates for Bot API 5.3 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/460
    • Updates for Bot API 5.4 by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/486
    • Create interface for file data by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/469
    • Deduplicate code, improve response accuracy. by @Syfaro in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/202

    New Contributors

    • @AlessandroPomponio made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/305
    • @CNA-Bld made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/312
    • @biodranik made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/336
    • @zergon321 made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/261
    • @ErrorBoi made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/321
    • @ErikPelli made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/388
    • @Eivel made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/375
    • @antsupovsa made their first contribution in https://github.com/go-telegram-bot-api/telegram-bot-api/pull/267

    Full Changelog: https://github.com/go-telegram-bot-api/telegram-bot-api/compare/v5.0.1...v5.4.0-beta.0

    Source code(tar.gz)
    Source code(zip)
  • v4.6(Nov 25, 2016)

    This release adds the new features and changes from the Telegram Bot API 2.3.

    Please note that Telegram is deprecating the hide_keyboard field in favor of remove_keyboard.

    Source code(tar.gz)
    Source code(zip)
  • v4.5.1(Aug 1, 2016)

    chat_id and message_id should be sent only if there is no inline_message_id (and vice versa), according to documentation. Without this change it is impossible to edit a message by InlineMessageID, because chat_id and message_id are always presented in a query and the Telegram server tries to use them instead of InlineMessageID

    https://github.com/go-telegram-bot-api/telegram-bot-api/pull/55

    Source code(tar.gz)
    Source code(zip)
  • v4.5.0(Jul 27, 2016)

    This release adds the following new helper methods.

    • NewInlineQueryResultArticleMarkdown(id, title, messageText string)
    • NewInlineQueryResultArticleHTML(id, title, messageText string)
    • NewInlineQueryResultPhotoWithThumb(id, url, thumb string)

    It also fixes a bug where update offsets could not be negative, which is a valid value.

    Source code(tar.gz)
    Source code(zip)
  • v4.4.0(May 22, 2016)

  • v4.3.0(May 21, 2016)

  • v4.2.1(May 3, 2016)

  • v4.2.0(Apr 23, 2016)

  • v4.1.0(Apr 15, 2016)

  • v4.0.0(Apr 14, 2016)

  • v3.0.0(Mar 24, 2016)

  • v2.2.1(Feb 28, 2016)

  • v2.1.0(Jan 18, 2016)

  • v2.0.0(Jan 4, 2016)

    This version removes previously deprecated functions and values, prefixes all error constants with Err, removes a string error and replaces it with a constant, makes Message.Command return just the command without slash or bot name if specified, and removes the http.Handler returned by ListenForWebhook.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jan 4, 2016)

    All documention is now less than 80 characters wide. Old methods now show deprecated warnings. The Values/Params/Method functions are now private. Types and configs have required and optional comments on them. Simplified some function logic.

    Source code(tar.gz)
    Source code(zip)
Owner
Golang library for the Telegram Bot API
null
(Golang) Go bindings for the Hugging Face Inference API

hfapigo (Golang) Go bindings for the Hugging Face Inference API. Directly call any model available in the Model Hub. An API key is required for author

Tanner Kvarfordt 6 May 21, 2022
Golang wrapper for the Sylviorus antispam API for telegram

Syl-Go Golang wrapper for the Sylviorus antispam API for telegram package test

Pranav Ajay 1 Jan 2, 2022
(Golang) Go bindings for Discord

DiscordGo DiscordGo is a Go package that provides low level bindings to the Discord chat client API. DiscordGo has nearly complete support for all of

null 3.5k Nov 27, 2022
Go bindings for libappindicator3 C library

go-appindicator Go bindings for libappindicator3 C library. Libappindicator is a library to allow applications to export a menu into the Unity Menu ba

Gopher Libs 3 Sep 26, 2022
Mrrobot - A simple greetings bot for Slack that uses events api and hosted on AWS Lambda

Mr. Robot a greeter bot for your slack community build_docker

Andrew Minkin 1 Aug 21, 2022
A serverless teeny-tiny version of Diomedes which sends alerts to Telegram. Written in Go.

diomedes-search Get a notification on Telegram whenever your movie opens bookings in a theater of your choice. Pre-requisites Install AWS CLI (v2) by

Kanishk Singh 2 Oct 11, 2022
Send messages from slack incoming webhook integrations to telegram

slack-to-telegram Slack incoming webhook to telegram Send messages from slack incoming webhook integrations to telegram Tested on Gitlab Slack Notific

Tim 3 Jul 19, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Siva Prakash 3 Feb 6, 2022
🤖🚀📦 A Discord Bot for accessing the cdnjs platform

A bridge between https://cdnjs.com/api and Discord Big shoutout to Br1ght0ne for helping me with writing helpers.go/SplitIn

Ilya Revenko 17 Aug 17, 2022
🤖 Chegg answers requested and sent by the Discord BOT to the targeted user.

"I believe that open-source resources are a must for everyone around. Especially in the field of education. As Chegg costs some money monthly, unfortunately, not all of us are capable of to charge ourselves that cost, which ends up blocking all those valuable resources to us. That is why, I have developed this bot, which unblurs the blurred question answers and sends them to you. I will develop it to a next level in the upcoming days, whereas, it will send the images/text, answers in short, directly through the Discord server you are in, or just DM/PM."

Vusal Ismayilov 33 Aug 20, 2021
A bot that tweets posts with the Go tag on Qiita

GoTwitterBot A bot that tweets posts with the Go tag on Qiita go mod init main/main go get github.com/joho/godotenv go get github.com/ChimeraCoder/a

Ibuki Yoshida 9 Oct 4, 2021
This bot require you to run the GETH client + use ethers framework.

Mad Liquidity Sniper This bot require you to run the GETH client + use ethers framework. All addresses and private keys contained have been changed fo

MAD CRYPTO 0 Oct 19, 2021
Chat bot for twitch

Microbot Chat bot for twitch. Run You need to provide config and cred files.

null 1 Oct 23, 2021
Trojan discord bot, used for grieving discord servers

disc-TROJAN-go Trojan discord bot, used for grieving discord servers How Does It Work? disc-TROJAN-go is a discord bot with hidden features. At the ti

null 3 Feb 28, 2022
An API client for the Notion API implemented in Golang

An API client for the Notion API implemented in Golang

Anatoly Nosov 343 Nov 9, 2022
A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Sreekanth Sasi 3 Oct 25, 2021
Arweave-api - Arweave API implementation in golang

Arweave API Go implementation of the Arweave API Todo A list of endpoints that a

Joshua Lawson 1 Jan 16, 2022
Reservationbox-api - Reservationbox Api with golang

reservationbox-api How to set up application Cloning git on this link : https://

null 0 Jan 30, 2022
Go api infra - Infrastructure for making api on golang so easy

Go Infra Api Infrastructre methods and types for make api simple Response abstra

Anosov Konstantin 1 Jun 18, 2022