Categorygithub.com/deadblue/telegram-bot
repositorypackage
0.1.0
Repository: https://github.com/deadblue/telegram-bot.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Telegram Bot

Reference

Go bindings for Telegram Bot API.

Supports most Bot APIs in version 4.9, except:

Example

import (
    "github.com/deadblue/telegram-bot"
    "github.com/deadblue/telegram-bot/parameters"
    "github.com/deadblue/telegram-bot/parameters/keyboard"
    "github.com/deadblue/telegram-bot/parameters/text"
)

// Create a bot instance
bot := telegram.New("your_bot_token")

// Get bot information
me, err := bot.GetMe()
if err != nil {
    panic(err)
}

// Prepare text message parameters
params := new(parameters.SendMessageParams)
params.ChatId(1234) 
params.Text(text.MarkdownV2("*Hello, world*"))
params.InlineKeyboard( (&keyboard.InlineBuilder{}).
    AddUrlButton("URL", "https://dead.blue").
    Build() )
// Send message
msg, err := bot.SendMessage(params)
if err != nil {
    panic(err)
}

Reference

LICENSE

MIT