recognition

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 9 Imported by: 0

README

Recognize plugin

This plugin listens for something like:

!recognize @person1 for [some great reasons]
!recognize @person1 and @person2 for [other reasons]
!recognize @person3, @person5 and @person22 for [many great feats]

The bot will then announce the recognition in the configured #recognitions channel. It will then listen on reactions for that announcement and keep track of who reacted.

In the end, another process can take those numbers and recognitions, their sender/initiator, list of recipients, and decide to feed it to a concrete recognition (based on bonus or whatnot) system.

This is a nice example of the use of reactions as buttons.

Configuration

Config keys for this plugin look like:

{
  ...
  "Recognition": {
    "domain_restriction": "@yourdomain.com",
    "channel": "#recognitions"
  },
  ...
}

domain_restriction checks that users voting have an e-mail ending with the given string.

channel is the channel where recognitions will be broadcast.

Documentation

Overview

Package recognition is a plugin for bawt that recognizes team members

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DomainRestriction string `json:"domain_restriction"` // Only accept up votes from people with emails ending with this value.
	Channel           string `json:"channel"`            // Name of the channel where recognitions will be shouted to.
}

type Plugin

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

func (*Plugin) InitPlugin

func (p *Plugin) InitPlugin(bot *bawt.Bot)

type Recognition

type Recognition struct {
	MsgTimestamp string // Slack Msg TS
	CreatedAt    time.Time
	FulfilledAt  time.Time
	Sender       string         // Slack User ID
	Recipients   []string       // Slack User IDs
	Reactions    map[string]int // [slackUID] = count of reactions
	Categories   []string       // ["1.4", "4.5"]
}

type Store

type Store interface {
	Get(ts string) *Recognition
	Put(*Recognition)
	All() map[string]*Recognition
}

Jump to

Keyboard shortcuts

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