Git Product home page Git Product logo

mattermost-plugin-memes's Introduction

Disclaimer

This repository is community supported and not maintained by Mattermost. Mattermost disclaims liability for integrations, including Third Party Integrations and Mattermost Integrations. Integrations may be modified or discontinued at any time.

Mattermost Memes Plugin

Build Status Code Coverage

Maintainer: @hanzei

This plugin will create a slash command that you can use to create memes!

/meme everywhere "memes." "memes everywhere"

For more information like available memes or command syntax type /meme and press enter.

Installation

  1. Go to https://github.com/mattermost/mattermost-plugin-memes/releases/latest to download the latest release file in zip or tar.gz format.
  2. Upload the file through System Console > Plugins > Management. See documentation for more details.

Development

Read our documentation about the Developer Workflow and Developer Setup for more information about developing and extending plugins.

Run make memelibrary to bundle up the meme assets (images, fonts, etc.).

For convenience, you can run the plugin from your terminal to preview an image for a given input. For example, on macOS, you can run the following to generate the above meme and open it in Preview:

go run server/plugin.go -out demo.jpg 'memes. memes everywhere' && open demo.jpg

This is especially useful when adding or modifying memes as you can quickly modify assets, make memelibrary, and preview the result using the above command. (See the files in memelibrary/assets to get started with that.)

mattermost-plugin-memes's People

Contributors

aconitumnapellus avatar apoxa avatar asimsedhain avatar ccbrown avatar cpanato avatar crspeller avatar cwarnermm avatar erdeerdeerde avatar grigalashvilit avatar halvaborsch avatar hanzei avatar hornet-wing avatar jfrerich avatar joernhees avatar jthebab avatar justinegeffen avatar jwilander avatar kuestenkeks avatar levb avatar mickmister avatar nathanaelhoun avatar phoinixgrr avatar ravinderj avatar spirosoik avatar toninis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-plugin-memes's Issues

Supporting non english characters

Hi,
First off, Great plugin
have a question, hebrew is not supported, all i get when i try to put hebrew characters, the pic comes blank
is that something that can work?

Only the first two words are inserted

When I execute the following command, only the first two words are inserted into the image.

/meme aliens first line. second line

image

However, if I execute /meme memes. memes everywhere, the result is as in read me. It also works with other or more words, but not with defined memes.

Make memes collapsible

It would be nice to have the meme images collapsable like media embedded via a link in mattermost.
image

image

Parse memes at runtime?

This is a feature request to make the plugin code and meme resources modular. Then server admins could add or edit memes any time without having to have them officially included via a PR, or set up a dev environment to recompile from a fork. The plugin could scan files on (re)activation, include valid ones, and log errors for invalid ones.

I also thought JSON metadata might be friendlier for this. Golang projects seem to use it fairly universally, it's more widely known, and has fewer pitfalls than YAML.

issue with " caracter on iOS

when trying to create a meme in iOS using the standard keyboard, one would get this caracter: “, in stead of " caracter, causing the script to interprete /meme brian “some text“ as a text string ' “some text“ ', and thereby corresponding to /meme brian "“some" "text“" not creating the correct meme.
Suggestion : auto replace “ with " in all strings

Generated memes do not appear in iOS app

Everything is in the title, just did a fresh install (Mattermost & mattermost-plugin-memes) works like a charm on desktop & web, but I get blank posts from the mobile version.

Add SiteURL before image path

I am running Mattermost with the bridgebot Matterbridge. When I post gifs from Discord for example the show up fine on Mattermost. But this plugin sends only a text like this:

[success-kid](/plugins/memes/templates/success-kid.jpg?text=enables+memes+plugin&text=gets+all+the+people+to+switch+to+Mattermost)

Would it be possible to (also?) post a functional URL and let Mattermost handle the display of the image? That way people on bridged channels also get to see the memes. Thanks!

Verify Image Proxy requests from server (Image Proxy and Post Metadata do not work)

I am experiencing an issue with this plugin on the Desktop App for Mac and through the browser. On the iOS app, this plugin works as expected.

In the interfaces that are not working, a blank message is posted and the following logs are printed to the Server Logs (this is in debug mode already):

{"level":"warn","ts":1553089421.5354636,"caller":"app/post_metadata.go:465","msg":"Failed to write link metadata","request_url":"https://<mattermost_server>/plugins/memes/templates/brace-yourselves.jpg","error":"SqlLinkMetadataStore.Save: store.sql_link_metadata.save.app_error, url=https://<mattermost_server>/plugins/memes/templates/brace-yourselves.jpg, Error 1062: Duplicate entry '2412853382' for key 'PRIMARY'"}
{"level":"error","ts":1553089421.671403,"caller":"log/log.go:289","msg":"forbidden content-type: \"text/html\"","source":"stdlog"}

Update 3/22/2019:

The error is the image proxy complaining that whatever link is being posted by the meme plugin is not an image. It looks like the meme plugin needs the user to log in or else it just returns an error page. Perhaps we need some way for plugins to verify that a request is coming from the image proxy since the current method of checking for the Mattermost-User-Id header doesn't work if the request comes from the server (either the image proxy or the post metadata logic).

I have removed the image proxy for now, and the memes display!

Only first text token is rendered

With Mattermost Version 7.0.0 and the Memes plugin 1.4.0 only part of the text displays.

Using the example from the README: /meme everywhere "memes." "memes everywhere" results in:

image

Similarly the example from everywhere.yaml used as /meme geese. geese everywhere also displays just:

image

Crash for some texts

Working:
/meme brace-yourselves Its Sunday

Not working:
/meme brace-yourselves It's Sunday

Result:
"Internal Server Error" and the following log entry

{"level":"error","ts":1618726829.0428991,"caller":"mlog/log.go:232","msg":"error resolving meme","path":"/api/v4/commands/execute","request_id":"warwwuchztb978swhjfp7jey7e","ip_addr":"93.218.248.222","user_id":"f3c6mis46byi8mhj3bmfswbmrc","method":"POST","err_where":"ExecuteCommand","http_code":500,"err_details":"Unterminated single-quoted string"}

Mattermost 5.34.2 with NGINX

Integrate GolangCI-Lint

Mattermost is currently in the process of using golangci-lint as the default linter for all go projects. mattermost-community/mattermost-plugin-autolink#108 serves as an example of how the migration should look like:

  1. Copy .golangci.yml from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  2. Copy Makefile from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  3. Copy build/ from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  4. Run go mod tidy and make dist to ensure the build system works fine.
  5. Update linters-settings.goimports.local-prefixes to the go module path i.e. to github.com/mattermost/mattermost-plugin-aws-SNS.
  6. Run make golangci-lint and fix all issues that arise.

Fixing an linter issue is sometimes trivial but can also be quite complicated. There might be cases, where ignoring an issue using issues.exclude-rules is needed. If you don't know how to resolve an error, please reach out to @hanzei on the Mattermost Community Server or ask the question here.

Additional metadata options, text rotation, support for Opentype fonts

Hi, I've been experimenting in a local fork and added support for additional metadata options in the yaml files, namely horizontal and vertical alignment, outlineWidth, outlineColor. These already had the core features present, so it was relatively simple to add in the yaml options.

I wanted to rotate text for the change-my-mind meme template, so I experimented with using the fogleman/gg library instead of the current image library. I managed to do it and thus the metadata can now accept text slots with a rotation value in degrees.

Lastly, I modified the font support to accept OTF fonts as well.

I'm mentioning all these as I understand that there is a Contribution checklist. These are features that do not yet have a ticket and they are definitely changes of more than 20 lines of code, so I was hoping that this could become the ticket.

Modular library

Hello,

Would it be possible to convert the hard coded list of images and slots into a modular one ?
A folder with

  • The images
  • A yaml file for each image, with the same name, containing slots (as actually),
    And a script that build automatically the list with what it find in the library.
    (I think it is the file "assets.go" but I'm not sure)

According to this PR:
https://github.com/mattermost/mattermost-plugin-memes/pull/46/files
the difficult thing seems to be the line of bytes, is it the file hard coded ?

It can be manually launched (no need to rebuild every morning) and it could return errors in command line, as it would be only done by the admin and not the users.

(sorry I'm no dev)

In any case, thank you for the plugin so far !

Missing emojis since Mattermost 5.37

After upgrading to Mattermost 5.37 we are missing some emojis (e.g. :trollface:). I believe we had this emoji because of this plugin

Could it be, that the emojis were custom emojis? Because there is a note in the changelog of Mattermost.

v5.37 adds support for emoji standard v13.0. If you have added a custom emoji in the past that uses one of the new system names, then that custom emoji is going to get overwritten by the system emoji. The workaround is to change the custom emoji name.

Or any other idea why we don't have these emojis anymore?

Cyrillic symbols support

I'd like to create memes using russian, but cyrillic symbols are displayed incorrectly (any symbol is replaced by square with a cross inside it) or don't displayed at all.

Is there any way to add cyrillic symbols support?

Doesn't work on fresh install

image

This is my problem right now, it's a fresh install of mattermost, and I have installed and reinstalled the plugin several times and I still have the same problem. There is also nothing on the logs.

Can someone help?

make: *** No rule to make target 'vendor'. Stop.

Hello,

I've just installed a new Mattermost server in my school and I want to configure this plugin to make funnier to my students ... ;-)

I've cloned the git repo and follow the installation steps, but I've got this error:

make: *** No rule to make target 'vendor'. Stop.

I've no idea of programming, so sorry if my question is obvious. I think that the problem is that the file vendor doesn't exist in the folder of the plugin, but I clone it from the official source.

Any idea to help us?

Thanks,

Make Memeplugin accept .gif files

Would be nice for the plugin to support gif files, tried adding one to the assets/images folder with the corresponding .yaml file but got an error when i updated the Plugin on the Server.

"Unterminated single-quoted string" when trying to generate meme

{"level":"error","ts":1568314153.4204962,"caller":"mlog/log.go:172","msg":"error resolving meme","path":"/api/v4/commands/execute","request_id":"iq4rghosbjra5ececu1zg9ic4h","ip_addr":"98.2.226.53","user_id":"t6hzpmdfytgmunhrcy8bgzx5br","method":"POST","err_where":"ExecuteCommand","http_code":500,"err_details":"Unterminated single-quoted string"}
{"level":"error","ts":1568314538.1719606,"caller":"plugin/hclog_adapter.go:60","msg":"reading plugin stderr","plugin_id":"memes","wrapped_extras":"errorread |0: file already closed"}

I've just uninstall 1.0.0 and installed 1.1.1. I was seeing this behavior in 1.0.0 and so upgraded to try and fix. So I now have the latest release, BUT I am seeing this error in the logs. I also am seeing a broken image and the token for the meme when I press enter.

Screen Shot 2019-09-12 at 3 10 00 PM

then

Screen Shot 2019-09-12 at 3 10 05 PM

Any thoughts?

Sort memes alphabetically in the list

Currently, the memes are ordered in the autocomplete feature, but not in the list of meme when /meme is called.

image

It would be handy if they were sorted.

If we implement this change, can we implement the sort directly in getAvailableMemes() (plugin.go) as we always want them sorted ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.