Documentation
¶
Overview ¶
Package chatpush sends an alert's words to a chat app beside Bark (gandli on X): a Telegram bot's message to one chat (Bot API sendMessage), a Discord channel's webhook, and a Pushover app's message to a user or group (VersunPan on X). Each is one POST of JSON. The bot token, the webhook address and Pushover's token and user key are secrets: an error names the server's answer, never them, as the token sits in Telegram's address and the webhook's token in its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PushoverAPI = "https://api.pushover.net/1/messages.json"
PushoverAPI is Pushover's message API; a var for tests, as TelegramAPI.
var TelegramAPI = "https://api.telegram.org"
TelegramAPI is the Bot API's server; a var for tests, here and in the packages that send alerts.
Functions ¶
func PushDiscord ¶
PushDiscord posts title and body to d's channel, as magpie, mentioning no one whatever the words hold.
func PushPushover ¶
PushPushover sends title and body to p's user as one plain-text message: the title as Pushover's title, the body as its message.
Types ¶
type Discord ¶
type Discord struct {
Webhook string
}
Discord is a channel's webhook address, as its Integrations page copies it.