/matterpoll-emoji

Poll server for Mattermost

Primary LanguageGoMIT LicenseMIT

matterpoll-emoji

Build Status Code Coverage Go Report Card Releases

Polling feature for Mattermost's custom slash command.

Requirements

Setup Guide

Setup Mattermost

Create a Custom Slash Command from Integration > Slash Commands > Add Slash Command.

  • DisplayName - Matterpoll
  • Description - Polling feature by https://github.com/kaakaa/matterpoll-emoji
  • Command Trigger Word - poll
  • Request URL - http://localhost:8505/poll
  • Request Method - POST
  • Response Username - Leave this empty
  • Response Icon - Leave this empty
  • Autocomplete - Enable this
  • Autocomplete Hint - [Question] [Option1] [Option2]...
  • Autocomplete Description - Start a poll

Copy the Token from your newly created slash command

Setup server

Run pre compiled release

Download the latest version at https://github.com/kaakaa/matterpoll-emoji/releases/latest. Decompress it and change parameter in config.json as you need them

{
  "host": "http://mattermost.example.com:8065",  // The URL of your Mattermost server
  "listen": "localhost:8505",  // The address:port to listen on
  "token": "9jrxak1ykxrmnaed9cps9i4cim",  // The Token created my Mattermost
  "user": {
   "id": "bot",          // The username of an existing Mattermost account
   "password": "botbot"  // The password of an existing Mattermost account
 }
}

Run the server

./matterpoll-emoji

Compile the source my yourself

Clone this repository and checkout the latest release. You can just use the master branch but it can be unstable.

go get -u https://github.com/kaakaa/matterpoll-emoji
cd $GOPATH/src/github.com/kaakaa/matterpoll-emoji
git checkout $(git describe --tags)

Copy the default config

cp .config.json config.json

Change parameter in config.json as you need them

{
  "host": "http://mattermost.example.com:8065",  // The URL of your Mattermost server
  "listen": "localhost:8505",  // The address:port to listen on
  "token": "9jrxak1ykxrmnaed9cps9i4cim",  // The Token created my Mattermost
  "user": {
   "id": "bot",          // The username of an existing Mattermost account
   "password": "botbot"  // The password of an existing Mattermost account
 }
}

Run the server

make run

Usage

Typing this on Mattermost

/poll `What do you gys wanna grab for lunch?` :pizza: :sushi: :fried_shrimp: :spaghetti: :apple:

then posting poll comment

screen_shot

You can use " or ' instead of `

License