A simple Go library for sending notifications across multiple channels (desktop, iMessage, Telegram, and more).
- 🖥️ Desktop notifications (macOS)
- 📱 iMessage notifications (macOS)
✈️ Telegram notifications (cross-platform)- 🔧 Simple configuration
- 🧪 Built-in testing
- 📦 Easy to integrate
-
Initialize configuration:
make init
-
Edit configuration: Edit
pinger.confto set your preferences:ENABLE_IMESSAGE=true DESKTOP_SOUND=Ping PHONE_NUMBER=+1234567890 ENABLE_TELEGRAM=true TELEGRAM_BOT_TOKEN=your_bot_token_here TELEGRAM_CHAT_ID=your_chat_id_here
-
Test your configuration:
make test
package main
import (
"github.com/NovemberFork/go-pinger"
)
func main() {
// Create configuration
config := pinger.PingerConfig{
EnableDesktop: true,
DesktopSound: "Ping",
EnableIMessage: true,
PhoneNumber: "+1234567890",
EnableTelegram: true,
TelegramBotToken: "your_bot_token",
TelegramChatID: "your_chat_id",
}
// Create pinger instance
p := pinger.NewPinger(config)
// Send notifications
p.Ping("Alert", "Something important happened!")
p.PingSimple("Simple message")
}| Setting | Description | Default |
|---|---|---|
ENABLE_DESKTOP |
Enable desktop notifications | true |
DESKTOP_SOUND |
Sound for desktop notifications | Ping |
ENABLE_IMESSAGE |
Enable iMessage notifications | false |
PHONE_NUMBER |
Phone number for iMessage (optional) | "" |
ENABLE_TELEGRAM |
Enable Telegram notifications | false |
TELEGRAM_BOT_TOKEN |
Bot token from @BotFather | "" |
TELEGRAM_CHAT_ID |
Chat ID to send messages to | "" |
To use Telegram notifications:
-
Create a Telegram Bot:
- Open Telegram and search for
@BotFather - Send
/newbotand follow the instructions - Save the bot token provided
- Open Telegram and search for
-
Get your Chat ID:
- Start a chat with your new bot
- Send any message to the bot
- Visit
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Look for the
"chat":{"id":...}field in the response - Use this ID as your
TELEGRAM_CHAT_ID
-
For channel notifications:
- Add your bot to the channel as an administrator
- Use the channel ID (usually starts with
-100) asTELEGRAM_CHAT_ID
go get github.com/NovemberFork/go-pinger@latestmake init- Create a new configuration filemake test- Test the current configurationmake build- Build the binarymake version- Show version informationmake tag- Create git tag for current versionmake release- Create and push release tagmake clean- Clean build artifacts
- Email notifications
- SMS notifications (via Twilio, etc.)
- Slack notifications
- Discord notifications
- Webhooks support