Maintainer: @moussetc
A Mattermost plugin to post GIFs from Gfycat, Giphy or Tenor with slash commands.
- Send a GIF directly with
/gif <keywords>
:
- Choose a GIF privately before sending with
/gifs <keywords>
:
Use the following table to find the correct plugin version for each Mattermost server version:
Mattermost server | Plugin release | Incompatibility |
---|---|---|
5.20 and higher | v1.2.x+ | breaking plugin manifest change |
5.12 to 5.19 | v1.1.x | breaking plugin API change |
5.10 to 5.11 | v1.0.x | buttons on ephemeral posts |
5.2 to 5.9 | v0.2.0 | |
4.6 to 5.1 | v0.1.x | |
below | not supported | plugins can't create slash commands |
In Mattermost 5.16 and later:
- In Mattermost, go to Main Menu > Plugin Marketplace.
- Search for the "GIF Commands" plugin, then click Install to install it.
- Once the installation is completed, click Configure. This will take you to System Console to configure the plugin.
- Choose if you want to use Gfycat (default), GIPHY or Tenor (both of which requires an API key, see below).
- If you've chosen Giphy or Tenor, configure the API key as explained on the configuration page.
- You can also configure the following settings :
- display style
- rating (not available for Gfycat)
- language (not available for Gfycat)
- Activate the plugin in the
System Console > Plugins Management > Management
page
If you are running Mattermost 5.15 or earlier, or do not have the Plugin Marketplace enabled, follow these steps:
- Go to the Releases page and download the
.tar.gz
package. Supported platforms are: Linux x64, Windows x64, Darwin x64, FreeBSD x64. - Use the Mattermost
System Console > Plugins Management > Management
page to upload the.tar.gz
package - Go to the
System Console > Plugins > GIF commands
configuration page that appeared, and choose if you want to use Gfycat (default), GIPHY or Tenor (both of which requires an API key, see below). - If you've chosen Giphy or Tenor, configure the API key as explained on the configuration page.
- You can also configure the following settings :
- display style
- rating (not available for Gfycat)
- language (not available for Gfycat)
- Activate the plugin in the
System Console > Plugins Management > Management
page
If you are running Mattermost v5.11 or earlier in High Availability mode, please review the following:
- To install the plugin, use these documented steps
- Then, modify the config.json using the standard doc steps to the following (check the plugin.json file to see the lists of options for language, rating, rendition, etC.).
"PluginSettings": {
// [...]
"Plugins": {
"com.github.moussetc.mattermost.plugin.giphy": {
"provider": "<giphy or gfycat or tenor>",
"apikey": "<your API key from Step 4. above, if you've choosen Giphy or Tenor as your GIF provider>",
"language": "en",
"rating": "",
"rendition": "fixed_height_small",
"renditiongfycat": "100pxGif",
"renditiontenor": "mediumgif"
},
},
"PluginStates": {
// [...]
"com.github.moussetc.mattermost.plugin.giphy": {
"Enable": true
},
}
}
- Is your plugin version compatible with your server version? Check the Compatibility section in the README.
- Make sure you have configured the SiteURL setting correctly in the Mattermost administration panel.
- Check the Mattermost logs (
yourURL/admin_console/logs
) for more detail on why the activation failed.
This happens when the plugin is not activated, see above section.
Start by checking the Mattermost logs (yourURL/admin_console/logs
) for more detail. Usual causes include:
- Using GIPHY as provider and using the public beta Giphy. The log will looks like:
{"level":"error", ... ,"msg":"Unable to get GIF URL", ... ,"method":"POST","err_where":"Giphy Plugin","http_code":400,"err_details":"Error HTTP status 429: 429 Unknown Error"}
. Solution: get your own GIPHY API key as the default one shouldn't be used in production. - If your Mattermost server is behind a proxy:
- If the proxy blocks Giphy, Tenor and Gfycat: there's no solution besides convincing your security department that accessing Giphy is business-critical.
- If the proxy allows Giphy, Tenor and Gfycat: configure your Mattermost server to use your outbound proxy.
- Your client (web client, desktop client, etc.) might be behind a proxy that blocks GIPHY, Tenor or Gfycat. Solution: activate the Mattermost image proxy.
- Check your Mattermost version with the compatibility list at the top of this page.
To build the plugin:
make
This will produce a single plugin file (with support for multiple architectures) for upload to your Mattermost server:
dist/com.example.my-plugin.tar.gz
There is a build target to automate deploying and enabling the plugin to your server, but it requires configuration and http to be installed:
export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_USERNAME=admin
export MM_ADMIN_PASSWORD=password
make deploy
Alternatively, if you are running your mattermost-server out of a sibling directory by the same name, use the deploy target alone to unpack the files into the right directory. You will need to restart your server and manually enable your plugin.
Feel free to create a GitHub issue or to contact me at @cmousset
on the community Mattermost instance to discuss.