Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 487 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 487 Bytes

go-mattermost

Simple Mattermost client for posting messages into channels using incoming webhooks.

package main

import (
	"fmt"
	"log"

	mattermost "github.com/dg-i/go-mattermost"
)

func main() {
	client := mattermost.NewClient(
		"https://chat.example.net/hooks/IiFtFtWf9WyszufkeJS3vv4v75",
		"MyBot",
		"town-square")

	err := client.SendSimpleMessage(fmt.Sprintf("Hello World! :tada:"))
	if err != nil {
		log.Fatalf("Somthing went wrong: %v", err)
	}

}