Every day, AI picks a popular meme template, captions it on your topic and posts the finished meme to your Discord channel.
Uses
ClaudeDiscord
Post a daily marketing meme to Discord
Every day at 10:00, the meme templates people caption most on Imgflip are fetched, AI picks one that suits your topic and writes the text for each of its boxes, Imgflip sets the captions on the picture, and the finished meme is posted to your Discord channel.
You describe the topic, the audience, the tone and what the memes must never touch. The angle rotates by date and the templates on offer change every day, so it is not the same joke twice. The AI's reply is checked before anything is made: it has to name a template from that day's list and fill every one of its text boxes, and nothing is posted until Imgflip has sent back a real image link.
What the memes are about ships blank, so say it in the brief before the first run. You also need a free Imgflip account, added as two secrets, and a Discord bot that can post in the channel.
memeBrief to {topic:,audience:"The people in your Discord community: customers and followers who know the topic from the insid.Set memeBrief to {topic:,audience:"The people in your Discord community: customers and followers who know the topic from the insid.discordChannelId to blank.Set discordChannelId to blank.postIntro to Meme of the day.Set postIntro to Meme of the day.memeBrief.topic is no or memeBrief.topic is blankIf memeBrief.topic is no or memeBrief.topic is blankdiscordChannelId and save it as channelIds.Extract all matches from discordChannelId and save it as channelIds.channelIds is emptyIf channelIds is emptychannelIds and save it as channelId.Get the last item of channelIds and save it as channelId.secrets.IMGFLIP_USERNAME is no or secrets.IMGFLIP_PASSWORD is noIf secrets.IMGFLIP_USERNAME is no or secrets.IMGFLIP_PASSWORD is nocatalogue to nothing.Set catalogue to nothing.fetchErrorIf a step below fails, save the error as fetchErrorhttps://api.imgflip.com/get_memes and save it as catalogue.Fetch https://api.imgflip.com/get_memes and save it as catalogue.fetchError.message), so no meme was made today and nothing was posted.Stop and report a problem: Imgflip's list of meme templates could not be fetched (fetchError.message), so no meme was made today and nothing was posted.catalogue.body.success isn't yes or catalogue.body.data.memes is noIf catalogue.body.success isn't yes or catalogue.body.data.memes is nocatalogue.body.data.memes where +item.box_count is greater than or equal to 1 and +item.box_count is less than… and save it as eligible.Keep each item in catalogue.body.data.memes where +item.box_count is greater than or equal to 1 and +item.box_count is less than… and save it as eligible.eligible is emptyIf eligible is emptyeligible and save it as offered.Pick 25 random items from eligible and save it as offered.menu to an empty list.Set menu to an empty list.position to 0.Set position to 0.template in offered:For each template in offered:position.Add 1 to position.position. template.name (text boxes: template.box_count) to the end of menu and save it as menu.Add position. template.name (text boxes: template.box_count) to the end of menu and save it as menu.menu with a new line and save it as menuText.Join menu with a new line and save it as menuText.todaysAngle to Any angle that suits the topic..Set todaysAngle to Any angle that suits the topic..memeBrief.angles is yes and memeBrief.angles isn't emptyIf memeBrief.angles is yes and memeBrief.angles isn't emptytodaysAngle to memeBrief.angles[the remainder of the day of the month of today's date divided by the length of memeBrief.angles].Change todaysAngle to memeBrief.angles[the remainder of the day of the month of today's date divided by the length of memeBrief.angles].today.Get today's date and save it as today.today and save it as weekday.Get the day of the week for today and save it as weekday.reply to nothing.Set reply to nothing.aiErrorIf a step below fails, save the error as aiErrormemeBrief.topic
WHO WILL SEE THEM
memeBrief.audience
HOW THEY SHOULD FEEL
memeBrief.tone
NEVER
memeBrief.avoid
TODAY'S ANGLE
todaysAngle
Today is weekday today. Use that only if it genuinely makes the joke better.
TODAY'S TEMPLATES
menuText
RULES
- Choose a template you know well: you must know what its picture shows, what each of its text boxes is for, and the order the boxes run in. If you are unsure about a template, choose another.
- Write exactly one line of text for every text box the template has, in the template's own box order. No more boxes and no fewer.
- Make one joke that someone in the audience gets at a glance, without an explanation.
- Keep every box under 60 characters. Shorter is funnier.
- Plain words only: no hashtags, emoji, quotation marks or markdown, and no line breaks inside a box.
REPLY FORMAT
Reply with only these lines. No preamble, no explanation, no alternatives.
TEMPLATE: <the template's number>. <its name, copied exactly from the list>
BOX 1: <the text for its first box>
Then one more BOX line for each further text box, numbered in order: BOX 2, BOX 3, BOX 4.'. Save it as reply.
Maximum response length: 400aiError.message). Nothing was made or posted.Stop and report a problem: The AI could not write today's meme (aiError.message). Nothing was made or posted.reply.response_text and save it as replyText.Trim reply.response_text and save it as replyText.replyText and save it as templateLine.Extract the first match from replyText and save it as templateLine.choice to +the first match in templateLine.Set choice to +the first match in templateLine.choice is less than 1 or choice is greater than the length of offeredIf choice is less than 1 or choice is greater than the length of offeredreplyText truncated to 300 characters using ... as the ellipsis.Stop and report a problem: The AI's reply did not pick a template from today's list, so nothing was made or posted. It began: replyText truncated to 300 characters using ... as the ellipsis.chosen to offered[choice minus 1].Set chosen to offered[choice minus 1].chosen.name in lowercase with nothing and save it as chosenKey.Join all matches in chosen.name in lowercase with nothing and save it as chosenKey.templateLine in lowercase with nothing and save it as replyKey.Join all matches in templateLine in lowercase with nothing and save it as replyKey.replyKey doesn't contain chosenKeyIf replyKey doesn't contain chosenKeychoice but did not call it by its name on today's list ('@chosen.name'), so its text may have been written for a different picture. Nothing was made or posted.Stop and report a problem: The AI picked template choice but did not call it by its name on today's list ('@chosen.name'), so its text may have been written for a different picture. Nothing was made or posted.replyText and save it as boxLines.Extract all matches from replyText and save it as boxLines.boxLines is not +chosen.box_countIf the length of boxLines is not +chosen.box_countchosen.box_count text boxes but the AI wrote the length of boxLines, so nothing was made or posted.Stop and report a problem: '@chosen.name' has chosen.box_count text boxes but the AI wrote the length of boxLines, so nothing was made or posted.captions to an empty list.Set captions to an empty list.boxLine in boxLines:For each boxLine in boxLines:boxLine with * replaced by with replaced by with “ replaced by with ” replaced by " uppercase and save it as caption.Make the first match in boxLine with * replaced by with replaced by with “ replaced by with ” replaced by " uppercase and save it as caption.caption is emptyIf caption is emptycaption is greater than 100If the length of caption is greater than 100caption characters, too long to read on a meme (the limit is 100), so nothing was made or posted. It was: caption.Stop and report a problem: One of the AI's captions ran to the length of caption characters, too long to read on a meme (the limit is 100), so nothing was made or posted. It was: caption.caption to the end of captions and save it as captions.Add caption to the end of captions and save it as captions.captioned to nothing.Set captioned to nothing.captionErrorIf a step below fails, save the error as captionErrorhttps://api.imgflip.com/caption_image and save it as captioned.Send data to https://api.imgflip.com/caption_image and save it as captioned.captionError.message). Nothing was posted.Stop and report a problem: Imgflip could not caption today's meme (captionError.message). Nothing was posted.captioned.body.success isn't yesIf captioned.body.success isn't yescaptioned.body.error_message is noIf captioned.body.error_message is nocaptioned.body.error_message. Nothing was posted. If that is about the username or password, check the IMGFLIP_USERNAME and IMGFLIP_PASSWORD secrets.Stop and report a problem: Imgflip did not make today's meme: captioned.body.error_message. Nothing was posted. If that is about the username or password, check the IMGFLIP_USERNAME and IMGFLIP_PASSWORD secrets.memeUrl to captioned.body.data.url.Set memeUrl to captioned.body.data.url.memeUrl is no or memeUrl doesn't start with https://If memeUrl is no or memeUrl doesn't start with https://message to memeUrl.Set message to memeUrl.postIntro is yes and postIntro isn't blankIf postIntro is yes and postIntro isn't blankmessage to postIntroChange message to postIntro
memeUrl.postErrorIf a step below fails, save the error as postErrorchannelId.Send a message to channel channelId.messagememeUrl) but could not be posted to Discord (postError.message). Check that your bot is in the server and is allowed to view the channel, send messages and embed links in it.Stop and report a problem: Today's meme was made (memeUrl) but could not be posted to Discord (postError.message). Check that your bot is in the server and is allowed to view the channel, send messages and embed links in it.captions joined by / ): memeUrl.Show in the output: Posted '@chosen.name' to Discord (captions joined by / ): memeUrl.