Skip to content

Custom Emoji manager command-line for Mattermost 😎

License

Notifications You must be signed in to change notification settings

linhmtran168/mmemoji

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI Build Status Quality Gate

mmemoji

Custom Emoji manager command-line for Mattermost 😎

Features:

  • Create custom Emojis
  • Delete custom Emojis
  • List custom Emojis
  • Search custom Emojis

Coming soon:

  • Export custom Emojis

Installation

pip install mmemoji
mmemoji --help

(Requires Python >=3.5)

Usage example

Let's take the Party Parrot Emojis as an example.

  • First, clone the Git repository or retrieve an archive of it:
git clone https://github.com/jmhobbs/cultofthepartyparrot.com.git
cd cultofthepartyparrot.com
  • Then you'll need your Mattermost credentials. You can either pass them to mmemoji with the arguments --url/--login-id/--password or via environment variables, for example:
export MM_URL='http://127.0.0.1:8065/api/v4'
export MM_LOGIN_ID='user-1@sample.mattermost.com'
export MM_PASSWORD='user-1'
  • Finally, run mmemoji to import all the parrots:
mmemoji create --no-clobber {parrots,guests}/hd/*.gif {parrots,guests}/*.gif

Notes:

  • Here we rely on shell globbing to select all emojis from the directories.
  • Specifying the hd directories first with --no-clobber ensures these emojis are created first and not overwritten by their lower quality counterpart.
  • If you ever want to remove them all, simply run the following:
mmemoji delete --force {parrots,guests}/hd/*.gif {parrots,guests}/*.gif

Notes:

  • The emoji names are extracted from the filenames the same way they have been during creation.
  • --force is used to ignore the absent low quality duplicates.

Development

  • You can clone this repository and install the project in editable mode:
pip install -e .
  • You'll find a script to create a local Docker test instance under tests/:
./tests/scripts/setup-mattermost.sh
  • You can run the test suite with:
python setup.py test
  • And last thing, you can install the pre-commit hooks to help with the formatting of your code.
pre-commit install

About

Custom Emoji manager command-line for Mattermost 😎

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 94.4%
  • Shell 5.6%