telegram_msg

package module
v0.0.0-...-5a8bdf8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2018 License: MIT Imports: 6 Imported by: 0

README

telegram-msg

Telegram BOT message sending library for Go (pretty basic).

package main

import "github.com/vadviktor/telegram-msg"

func main() {
    s := &telegram_msg.Telegram{}
    s.Create("someBotApiToken", 12345)
    s.Send("I can send plain fmt.Println.")
    s.Send("I can act like %s too.", "fmt.Sprintf")
    s.SendSilent("I can send silent messages the won't have notifications.")
}

Documentation

Overview

Package telegram provides a very basic and simple mean to send messages to a specific target (user/channel/group) via a chatbot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Telegram

type Telegram struct {
	// contains filtered or unexported fields
}

Telegram has all the required dynamic information.

func (*Telegram) Create

func (s *Telegram) Create(botToken string, targetID int)

Create initiates the Telegram Bot messenger using all the vital information provided.

func (*Telegram) Send

func (s *Telegram) Send(text string)

Send sends message over to the Telegram bot.

func (*Telegram) SendMD

func (s *Telegram) SendMD(text string)

SendMD sends message over to the Telegram bot. The message will be parsed using supported Markdown formatting. https://core.telegram.org/bots/api#formatting-options

func (*Telegram) SendSilent

func (s *Telegram) SendSilent(text string)

SendSilent sends message over to the Telegram bot. Sends the message silently. Users will receive a notification with no sound.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL