This tool provides the following functionalities:
- Split a large image into multiple tiles to assist users in uploading them as Slack emojis. (
split_to_tiles.py
) - Read a folder and batch upload the images as emojis to Slack. (
upload_emoji.py
) - Delete emojis from Slack based on filenames in a folder. (
delete_emoji.py
)
poetry shell
pip install -r requirements.txt
To use this tool, you need to set up the following environment variables. You can refer to the .env.example
file provided in the repository for guidance.
- COOKIE_D=example
- WORKSPACE=example
- TOKEN=example
You can either copy .env.example
to .env
and modify the values, or set these variables directly in your environment.
cp .env.example .env
# Then edit the .env file to include your actual values
You could read this docs to get COOKIE_D
and TOKEN
.
WORKSPACE
is the slack workspace, something like this -> https://{{WORKSPACE}}.slack.com/customize/emoji
This script, upload_emoji.py, is designed to upload emojis from a specified folder. The folder containing the emojis can be provided as an argument when running the script. If no folder is specified, the script will default to the ./tiles
folder.
It use filename as emoji tag name, e.g. filename: abc_5_4.png -> emoji tag: :abc_5_4:
python upload_emoji.py -f /path/to/emoji/folder
This feature allows users to divide a large image into smaller tiles, making it easier to upload them as individual emojis to Slack.
Also, it generate a emoji.txt for user easily paste to reconstruct the image in slack app.
python split_to_tiles.py path/to/your/image.png emoji_prefix -w 128 -o ./tiles
This feature allows users to delete emoji from a specified folder.
python delete_emoji.py -f /path/to/emoji/folder
This project is licensed under the MIT License. See the LICENSE file for more details.