fako1024 / rc-notify

Simple tool to emit messages via RocketChat Webhook REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Simple tool to emit messages via RocketChat Webhook REST API

Github Release GoDoc Go Report Card Build/Test Status

This package provides an interface to RocketChat's Webhook / notification REST API (provided an endpoint is made available) and a command line tool for simple message sending / delivery.

Installation

go get -u github.com/fako1024/rc-notify

Examples

Send a simple message

req := rc.Request{
	Channel: "@me",
	User:    "Sending User",
	Message: "My message",
	Emoji:   rc.EmojiAlert,
}

// Execute the request (set webhook URI accordingly)
uri := "https://your.rc.instance.com/hooks/.../..."
if err := rc.Send(uri, req); err != nil {
	log.Fatalf("Failed to send message: %s", err)
}

About

Simple tool to emit messages via RocketChat Webhook REST API

License:Apache License 2.0


Languages

Language:Go 100.0%