-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: added timestamp message pattern while sending to telegram bot #…
- Loading branch information
1 parent
bc42839
commit 6cea845
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
package example | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/sivaosorg/govm/bot/telegram" | ||
) | ||
|
||
// bot: t.me/javis_notify_forum_bot | ||
// group: https://t.me/javis_forum_bot | ||
// chat_id: -1002042977093 | ||
// token: 6806983892:AAGcPZiuNktLFnyVWrRyOyYssECcVmNJSRo | ||
func createTelegramService() telegram.TelegramService { | ||
options := telegram.NewTelegramOptionConfig().SetType(telegram.ModeHTML) | ||
svc := telegram.NewTelegramService(*telegram.GetTelegramConfigSample(). | ||
SetChatId([]int64{-1002042977093}). | ||
SetToken("6806983892:AAGcPZiuNktLFnyVWrRyOyYssECcVmNJSRo"). | ||
SetDebugMode(false), | ||
*options) | ||
|
||
return svc | ||
} | ||
|
||
func TestCardNotification(t *testing.T) { | ||
svc := createTelegramService() | ||
svc.SendWarning("Kafka Stream", "Kafka Streams is a part of the Apache Kafka project that enables developers to build real-time processing applications, where data can be ingested, processed, and transformed in real-time as it flows through the Kafka cluster. Kafka Streams is a library for building scalable and fault-tolerant stream processing applications without the need for a separate processing cluster.") | ||
} |