Skip to content

Introduction

Loïc LEUILLIOT edited this page May 2, 2017 · 7 revisions

Documentation version

When something is new, the first of all thing is to understand how it is working. Indeed, since source are open, you can try to understand this by yourself, but it's always easier if the original minder explain it to you.

But this way is hard for none initiated guy and I will try to explain important thing as simple as I'm able.

In addition, when you understand thing, it's easier to explain it to other and/or to find why something is broken.


Basics

If you want to "manage" your Slack team with SeAT, so you need to understand there is two place basically not connected together. By this thing, I mean what you're doing on SeAT is not known by Slack and reverse.

This package only provide you a way to keep thing as mush up to date as possible by using the technical thing

  • Slack API
  • Slack Events (kind of outgoing webhook)

Slack is providing a way to be informed about what you're browser or other Slack Application are doing using Slack Event

  • message has been sent
  • an user join the team/channel/group
  • a channel has been created/renamed/archived

Does thing are doable using event which can be found on official Slack documentation

Slack Events

Listening for events is the job of SeAT, but Slack is in charge of them. So Slack will inform SeAT every time an event to which you've subscibed is appening.

It will ensure that your SeAT always know what's happening on your Slack without you need to do anything yourself.

  • keeping channels name and id up to date
  • keeping users list up to date

(the relation between SeAT and Slack is only based on a simple table which is storing both Slack member ID and SeAT user id, you will find more information about this in package tablespace)

Slack Updater

The main command of this package is slack:update

Behind this command, there are two distinct job called Slack Receptionist and Slack Ass Kicker

The receptionist is checking guy in order to invite people into channels whereas the ass kicker is checking guy in order to kick people from existing channels.

This command is runned by a schedule which can be manage in SeAT. Recommanded frequency is every 5 minutes, it's not often in order to avoid to spam too much Slack API and it's enough to keep your Slack safe. In addition, 2.x release reduce the Slack API call amount by using redis. Everytime Slack is informing SeAT that something change in a channel, we push data in cache and the job is always checking cache first.

Rules

Following rules are followed by both Slack Ass Kicker and Slack Receptionist :

  • The user is handling keys which are all up to date and at least one account is pledged
  • If the user match to a channel permission and SeAT is already knowing the user Slack member ID, Slack Receptionist will invite on them
  • The user is handling at least one key which is no longer up to date or no longer have pledged account
  • Slack Ass Kicker will kick the user from all channel on which he is.
  • User which are on channel which not match to established permission
  • Slack Ass Kicker will kick the boy

Helpers Job

Since some guy would be able to use this package with an existing Slack Team, I'm providing the package with two usefull commands which are slack:channels:update and slack:users:update.

Slack Update Users

This command provide you a way to updating manually SeAT relation between Slack Member and SeAT User. It will use mail address as an aggregate point and stalking all your Slack Team member in order to established a connection with your SeAT user.

All SeAT account with another state than active will not be linked

People which have already been invited cannot be refund with Slack API, as a result, even if you've sent them an invitation, this command will not be able to connect the SeAT user.

Slack Update Channels

This command provide you a way to updating manually SeAT Slack knowledge about existing channels both public and private. As soon as it's ran, it will stalk your Slack Team and filling a table with both channel name and channel id.

The channel id will then be use for invite.

Important

I'm building this package using SeAT as master, it's an important thing which you always need to keep in mind when you're doing something on your Slack. This mean the bot will keep your Slack up to date based on it's own data. If you want to invite somebody without he's registered on SeAT, the bot will not do anything against him.

It can be considered both as a feature and a safety issue but in fact, it's the most safe way to do thing without disturbing your Slack Team too much. Maybe you're using it for something else than Eve Online.

Clone this wiki locally