Pretty-paste source code on Slack
Pasta is a Slack /command
that allow you to past source code
directly on channels. The source code is converted into a file and its
programming language is automatically detected.
-
Python 3.6+ required
-
Create your Slack app and tokens https://api.slack.com/:
-
Find Client ID at
Basic Information > App Credentials > Client ID
-
and Bot token at
OAuth & Permissions > OAuth Tokens & Redirect URLs > Tokens for Your Team > Bot User OAuth Access Token
-
-
Fill config/tokens.json with your Slack app tokens
-
Install Pasta on your server:
pip3 install .
- Run Pasta:
pasta-gunicorn
- You can also provide the tokens as environment variables
PASTA_DEBUG=1 \
PASTA_BOT_TOKEN="my-bot-user-token" \
PASTA_CLIENT_ID="my-app-client-id" \
pasta-gunicorn
- Create Pasta container
docker build -t pasta-img .
docker create -p 8000:8000 --name pasta \
-e PASTA_BOT_TOKEN="my-bot-user-token" \
-e PASTA_CLIENT_ID="my-app-client-id" \
pasta-img
- Start Pasta container
docker start pasta
- Stop Pasta container
docker stop pasta
-
Icon created by Demograph™ (Creative Commons)
-
Pasta — Copyright (c) 2020 Y. SOMDA, MIT License