Giter Site home page Giter Site logo

antibot's Introduction

Antibot

Introduction

This is a python framework to create slack bots.

It abstract most of the boilerplate code to interact with slack and encapsulate slack json data in nice native classes.

How to run

You need to create a new app on https://api.slack.com/apps. You need to activate interactive components, slash commands provide at least the following permissions to the bot :

  • users:read
  • users:read.email
  • files:write

You also need a way for slack to contact you server. In development you can use http://localhost.run/ although you will need to reconfigure interactive components and slash commands regularly.

You also need a virtualenv where you will install antibot and all of your plugins.

The following environment variables are mandatory for antibot to run :

  • SLACK_BOT_USER_TOKEN : can be found under Bot User OAuth Access Token in OAuth & Permissions page
  • SIGNING_SECRET : can be found in the Basic Information page
  • WS_API_KEY : is a random secret of you choice to call non-slack related api on your bot
  • MONGO_URI : an accessible mongo instance
  • DEV=true while in development

How to create a plugin

Use cookiecutter on https://github.com/JGiard/Antibot-plugins-template

Coding

There is lot of stuff you can do, check the other projects for examples.

Use @command("/myplugin/route") to react to slash command (don't forget to create the correspond command in slack).

Always use the block api from antibot.slack.messages when creating messages.

Use @block_action(action_id="...") to react to interactive components on messages.

Use @ws("/myplugin/route) to create a raw endpoint.

antibot's People

Contributors

jgiard avatar aminvielle 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.