Step 1: Create a member field to save the meme url to
When we get the meme url, we need to save it to a member field. You can learn more about member fields here. I created a text member field called message by going to member fields > create member field.
Step 2: Create an imgflip account
IMPORTANT: I recommend changing your imgflip password (imgflip > top right > Settings) to something you don't use with other accounts! Because you'll need to put that password in your BotDisco dashbaord and other server admins will be able to see this password from the BotDisco dashboard.
Step 3: Create a Slash Command flow
Step 4: Rename the flow and give the command a name
I renamed the flow to "Meme generator" and gave the command the name /meme and a description of "Create a meme"
Step 5: Add an external request action
Step 6: Move the "Reply to slash command" action down
So your flow should look like this:
Step 7: Open the External Request action and set the external request type to POST and add the url below
Add this URL and replace YOUR_USERNAME with your username and YOUR_PASSWORD with your password.
Step 8: Test the request
You should see "success": true in the response. If you don't, make sure you have the request type set to POST and your username and password are correct.
Step 9: Save the meme url to a member field
In the "Response Mapping" tab, set the Path to...
...and the field to "User that ran the slash command -> message". This will save the meme image url to the message member field we created earlier for our users.
Step 10: Show the meme
Show the meme by using that "Reply to slash command" action to show the message field.
Step 11: Save and test
Run the /meme slash command to see it work.
Step 12: Customize!
Right now, this command will show the same meme every time.
Let's give users the option to pick a meme template and fill in the text with their own words.
Modify the /meme command to have 3 options:
meme - This is the meme template.
text1 - This is the first text to show on the meme template
text2 - This is the second text to show on the meme template
Make sure your command options look like this:
Open the ADVANCED section of the meme option and add these choices. These are the meme templates we're letting users choose from. You can up to 25 choices! Here are the top 100 meme IDs.
Drake Hotline Bling
Batman Slapping Robin
Now, in the external request URL. replace the template ID value with the value for the meme option that the user is going to pick.
Do the same for text0 and text1.
Save and test!
The cool thing about imgflip is you can create your own custom meme templates! You get the template ID from the URL like this: