tgio

package module
v0.0.0-...-aa8bcc9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 6 Imported by: 0

README

tgio

Forward input to a telegram chat

Install

go get github.com/igolaizola/tgio/cmd/tgio

Example

echo hello | tgio --token <my-bot-token> -chat <my-chat-id>

Or using a config file

echo hello | tgio --config tgio.conf

where tgio.conf content is:

token <my-bot-token>
chat <my-chat-id>

How to get token and chat parameters

  • Talk to @BotFather to create a new bot with its token
  • Talk to @username_to_id_bot to obtain your chat ID or any other chat ID

Use it in your code

import "github.com/igolaizola/tgio"

...

err := tgio.Forward(ctx, reader, token, chat)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forward

func Forward(ctx context.Context, reader io.Reader, token string, chat int) error

Forward forwards reader data to a telegram chat by sending messages as a given bot.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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