slackbot

package module
v0.0.0-...-0a7d0a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 8 Imported by: 0

README

Slackbot

A Slack notifier library for Go applications.

##Usage

Create a new instance of SlackBot specifying the URL of Slack and the access token, then call the method "PostMessage" passing the channel and message.

Example:

    func SendSlackNotification() {
        b := slackbot.New("https://my_slack_hook_url", "my_slack_token")
        b.PostMessage("#random", "All your base ")
    }

Documentation

Overview

Package slackbot allows posting messages to Slack using the Slackbot API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SlackBot

type SlackBot struct {
	// contains filtered or unexported fields
}

SlackBot stores the the current config and methods

func New

func New(url string) SlackBot

New configures a new SlackBot instance with the given url

func (SlackBot) PostMessage

func (bot SlackBot) PostMessage(channel, message string) error

PostMessage sends the given message to the given channel as Slackbot

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL