Git Product home page Git Product logo

mattermost-hotdice's Introduction

Flask-based API for a Mattermost Dice Roller Webhook/Slash Command

This is a simple, lightweight Flask server used to do dice rolls in Mattermost channels.

There is both a custom slash command version as well as an outgoing web hook

Components

  • mattermost-hotdice.py Flask app that runs an simple API to query with a Mattermost outgoing webhook or slash command.

Requirements

  • python (tested on 2.7.5)
  • python-flask
  • Mattermost (tested on 4.3.2+)

Installation

  • Clone the repository
git clone https://github.com/sadsfae/mattermost-hotdice
cd mattermost-hotdice
  • Run the Python application via python mattermost-hotdice.py
    • You might want to run this via a systemd service or init script once you're happy with it.
    • You should run this as an unprivileged user, an example systemd service file is included.

Mattermost Server Settings

  • System Console -> Developer Settings -> Allow untrusted internal connections to: localhost
  • System Console -> Custom Integrations -> Enable integrations to override usernames: true
  • System Console -> Enable integrations to override profile picture icons: true

Setup

You only need one of these approaches. Slash commands are a bit more configurable as they can work in private chat or private channels.

Setting up as a Webhook

  • Main Menu -> Integrations -> Outgoing Webhook
    • Add Outgoing Webhook
    • Content-type: application/json
    • Trigger Words:
hotdice
Hotdice
  • Trigger When: First word matches a trigger word exactly
  • Callback URLs: http://localhost:8090/hotdice

Setting up as a Slash Command

  • Main Menu -> Integrations -> Slash Command
    • Add Slash Command
    • Description: /random 1000
    • Command Trigger Word: random
    • Request URL: http://localhost:8090/random
    • Request Method: POST

Action Pic

  • Webhook

hotdice

  • Slash Command

hotdice_slashcmd

mattermost-hotdice's People

Contributors

sadsfae avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.