the open-source slack watercooler.
right now, lambdacooler has a very simple purpose: create groups of some size and provide them with a conversation starter. you can run this however often you want to! over time, more cool social features will be added :) of course, feel free to add your own and submit pull requests!
if you've ever been in a large slack workspace, you know how hard it is to feel included. over time, you might find your group, but in doing so you might even pass up a chance to meet a lot of cool people. donut bot was created to help make people feel connected, introducing a watercooler for slack that would help spark conversation. unfortunately though, as with all good things, donut is now mostly paid, and is closed-source.
so i made lambdacooler. it's an open-source watercooler for slack, originally created for use by cs61a staff at uc berkeley. we tend to have a large staff over at 61a, which makes it hard to spark social connections, so i made this in an effort to help people get to know each other. i intend to keep adding cool features to this and maybe bringing it to a point where i feel like i've added enough to distribute this through the slack app marketplace. in the meantime, though, i'll keep this open-source, because i believe all good software should be open-source.
create a slack app from scratch in the right workspace. add the following bot token scopes:
channels:readto allow access to information about channels, including user listschat:writeto allow sending messages as@lambdacoolerim:writeto allow sending individual direct messages as@lambdacoolermpim:writeto allow sending group direct messages@lambdacoolerusers:readto allow reading user lists and profiles, minus email addresses
then, install the app in your workspace and copy the bot user oauth token.
- clone this repo
- run
python3 -m venv envto create a virtual environment - run
source env/bin/activateto activate the environment - run
pip install -r requirements.txtto install some python packages - create a file called
sensitive.pyand add the following:
TOKEN = "<the bot user oauth token>"
SOCIAL_CHANNEL = "<see below>"
LAMBDACOOLER_CHANNEL = "<see below>"
ADMIN = "<see below>"- to get the
LAMBDACOOLER_CHANNELid, use thechannelscommand inlc.pyand copy the id of the channel you want to treat as your lambdacooler hub. non-bot users in this channel will be included when you prepare a cooler. - to get the
SOCIAL_CHANNELid, do the same as above and copy the id of the channel where lambdacooler should remind people to join the lambdacooler hub channel if they want to be included when you prepare a cooler. - to get the
ADMINuser id, use theuserscommand inlc.pyand copy the id of your slack user (or, if the admin is someone else, then that user's id). - you may need to run
chmod +x lcin order to be able to use./lcinstead ofpython3 lc.py. trust me, it's worth it.
(env) $ ./lc --help
Usage: lc [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
channel Send a message to var.LAMBDACOOLER_CHANNEL.
channels Get all channel IDs and names in the current workspace.
cool Send cooler messages to the groups in ID.
join-reminder Remind people in var.SOCIAL_CHANNEL about lambdacooler.
prepare Prepare some coolers of SIZE or greater.
test Send a test message.
users Get all user IDs and names in the current workspace.
welcome Send var.WELCOME_MSG to var.LAMBDACOOLER_CHANNEL.
./lc usersto get admin user ID./lc channelsto get lambdacooler channel id./lc testto send yourself a test message./lc welcometo send a welcome message to the lambdacooler channel./lc prepareto prepare a grouping (let's assume it goes intodata/1632014965.json)- Change
variables.STARTERto a fun new starter question! ./lc cool -i 1632014965to send group direct messages to all the cooler groups indata/1632014965.jsonwith thevariables.STARTERstarter question
run deactivate when done to exit the virtual environment.
in the spirit of open-source, this code is under the gnu gplv3 license.
lambdacooler, the open-source slack watercooler.
Copyright (C) 2021 Vanshaj Singhania
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
see COPYING for a full copy of the gnu general public license.