You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/deadblue/telegroid

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/deadblue/telegroid

v0.1.0
Source
Go
Version published
Created
Source

Telegram Bot

Reference

Go bindings for Telegram Bot API.

Supports most Bot APIs in version 4.9, except:

  • Passport

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

FAQs

Package last updated on 01 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts