generated from PenaSide/GolangTemplate
38 lines
737 B
Go
38 lines
737 B
Go
|
package client
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
tb "gopkg.in/tucnak/telebot.v2"
|
||
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
||
|
"testing"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func Test_Telegram(t *testing.T) {
|
||
|
tbBot, err := tb.NewBot(tb.Settings{
|
||
|
Token: "6712573453:AAFqTOsgwe_j48ZQ1GzWKQDT5Nwr-SAWjz8",
|
||
|
Verbose: false,
|
||
|
ParseMode: tb.ModeHTML,
|
||
|
Poller: &tb.LongPoller{
|
||
|
Timeout: time.Second,
|
||
|
},
|
||
|
})
|
||
|
|
||
|
if err != nil {
|
||
|
fmt.Println(err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
tgClient := NewTelegramClient(TelegramClientDeps{
|
||
|
Notifier: tbBot,
|
||
|
NotifierPayChannel: -1002217604546,
|
||
|
})
|
||
|
|
||
|
err = tgClient.NotifyRsPay("test@email", &models.Verification{UserID: "test"}, 100.11111)
|
||
|
if err != nil {
|
||
|
fmt.Println(err)
|
||
|
return
|
||
|
}
|
||
|
fmt.Println("good")
|
||
|
}
|