telegram

package module
v0.0.0-...-72c8a5a Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessage

func NewMessage(message *coinapi.Message) tgbotapi.MessageConfig

NewMessage creates a new telegram message config

Types

type Bot

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

Bot defines the telegram bot coinapi.UserInterface api implementation.

func NewBot

func NewBot() (*Bot, error)

NewBot creates a new telegram bot implementing the coinapi.UserInterface api.

func (*Bot) Listen

func (b *Bot) Listen(key, prefix string) <-chan coinapi.Command

Listen exposes a channel to the caller with updates for the given prefix.

func (*Bot) Run

func (b *Bot) Run(ctx context.Context) error

Run starts the Bot and polls for updates from telegram.

func (*Bot) Send

func (b *Bot) Send(message *coinapi.Message, trigger *coinapi.Trigger) int

Send sends the given message with the attached details to the specified telegram chat.

Jump to

Keyboard shortcuts

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