-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Mods are watching #110
Comments
If you can produce the same end result with the imgur API, then that's fine 👍 I've created a mirror of the template here if that's any help. The only thing I notice is that while it is official, the imgurpython project has been deprecated since late 2017, so it may be better to find an alternative if possible. I'd welcome input from @issy or any other member of the team who has any suggestions regarding this. |
Ok thanks. I realized that it's probably easier to use the imgflip api to create custom memes (ie. (Mod name) is watching) so that's what I'll prob use. |
OK. You can use imgflip template ID 224894675. |
The purpose of the imgflip API in this cog is for image editing, not image storing - therefore the imgur API does not provide the same featureset that we need. |
Since the template's upper text box is in the correct position there's no need to specify anything more than the text, so this is very easy: >>> import requests
>>> body = {'username':'redacted','password':'redacted','template_id':'224894675','font':'arial','boxes[0][text]':'your mum'}
>>> req = requests.post('https://api.imgflip.com/caption_image',data = body)
>>> print(req.text)
{"success":true,"data":{"url":"https:\/\/i.imgflip.com\/5b5vyr.jpg","page_url":"https:\/\/imgflip.com\/i\/5b5vyr"}} I'm sure there's a better way to do it, but this works fine as a PoC. |
Thanks for the snippet, Tig. That's definitely different from what I was doing :D |
Suggested command usage RFC
|
This all looks really good! The frog and horse won't need any captioning right? |
Nope, they won't need any captioning. I've created imgflip templates for both of them, if that makes life easier. |
Also do you guys want a hardcoded username and password or is there some sorta config file that I can edit? And should the triggers be hardcoded? |
Pull the username/password from the API key store built into Red. Documentation here |
I'd like to suggest another command:
Also, a note regarding the enable|disable command: I think it should default to be global enable/disable if the second param is not specified. |
Noted. By trigger conflicts I assume you mean the auto reply triggers? |
|
Another idea I've just had: Nicknames would be best to use for the template text since they can differ from the username and members may know a mod by their nickname rather than username. I suggest that by default it uses the nickname, but has the following options available:
I'm aware I'm causing a lot of scope creep here, sorry about that. Clearly I didn't think this through very thoroughly! |
It's all fine. It will probably be a bit before I can get a working cog as I've never worked with RED before😅 |
No worries 👍 having this discussion helped us clear up a lot of the implementation details anyway |
Overview
Mods are watching functionality, à la Araquiel's
:eye:
trigger.Example:
Cog should build these images on the fly to avoid issues with hardcoding. Suggest using imgflip API or similar. If using imgflip, use template ID 224894675.
I'm not sure if this is best as an extension of the autoreply cog or a cog of its own. Due to this, I've not filled out the suggested commands below.
Commands
DoD
:eye:
) and the bot responds as demonstrated above.Stretch
:frog:
) or similar. Open to suggestions here!The text was updated successfully, but these errors were encountered: