slack

package module
v0.0.0-...-12fa50d Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2015 License: MIT Imports: 5 Imported by: 3

README

slack

Circle CI

GoDoc

Golang client library for posting messages in Slack.

License

Slack is MIT licensed, details can be found here.

Documentation

Overview

Package slack is a client library for Slack.

Usage:

package main

import (
  "github.com/Bowery/slack"
)

var (
  client *slack.Client
)

func main() {
  client = slack.NewClient("API_TOKEN")
  err := client.SendMessage("#mychannel", "message", "username")
  if err != nil {
    log.Fatal(err)
  }
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a slack api client. A Client is used for making requests to the slack api.

func NewClient

func NewClient(token string) *Client

NewClient returns a Client with the provided api token.

func (*Client) SendMessage

func (c *Client) SendMessage(channel, message, username string) error

SendMessage sends a text message to a specific channel with a specific username.

Jump to

Keyboard shortcuts

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