mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-18 04:40:03 +02:00
Remove internal/telegram/wrapper.go
This commit is contained in:
parent
9f1b2f3026
commit
6d8c63f958
1 changed files with 0 additions and 30 deletions
|
|
@ -1,30 +0,0 @@
|
|||
package telegram
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
_api "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
)
|
||||
|
||||
var (
|
||||
_bot *_api.BotAPI
|
||||
_channel int64
|
||||
_prefix string
|
||||
)
|
||||
|
||||
func Init(prefix string, id string, channel int64) error {
|
||||
var err error
|
||||
|
||||
_bot, err = _api.NewBotAPI(id)
|
||||
if err == nil {
|
||||
_prefix = prefix
|
||||
_channel = channel
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func Send(message string) error {
|
||||
msg := _api.NewMessage(_channel, fmt.Sprintf("%s: %s", _prefix, message))
|
||||
_, err := _bot.Send(msg)
|
||||
return err
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue