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
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 blankYes
No
No steps
discordChannelId and save it as channelIds.Extract all matches from discordChannelId and save it as channelIds.channelIds is emptyIf channelIds is emptyYes
No
No steps
channelIds 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 noYes
No
No steps
catalogue to nothing.Set catalogue to nothing.fetchErrorIf a step below fails, save the error as fetchErrorTry
https://api.imgflip.com/get_memes and save it as catalogue.Fetch https://api.imgflip.com/get_memes and save it as catalogue.On error
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 noYes
No
No steps
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.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 emptyYes
No
No steps
eligible 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 emptyYes
todaysAngle 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].No
No steps
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 aiErrorTry
memeBrief.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: 400On error
aiError.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 offeredYes
replyText 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.No
No steps
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 chosenKeyYes
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.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.No
No steps
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_countYes
chosen.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.No
No steps
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 emptyYes
No
No steps
caption is greater than 100If the length of caption is greater than 100Yes
caption 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.No
No steps
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 captionErrorTry
https://api.imgflip.com/caption_image and save it as captioned.Send data to https://api.imgflip.com/caption_image and save it as captioned.On error
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 yesYes
captioned.body.error_message is noIf captioned.body.error_message is noYes
No
captioned.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.No
No steps
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://Yes
No
No steps
message to memeUrl.Set message to memeUrl.postIntro is yes and postIntro isn't blankIf postIntro is yes and postIntro isn't blankYes
message to postIntroChange message to postIntro
memeUrl.No
No steps
postErrorIf a step below fails, save the error as postErrorTry
channelId.Send a message to channel channelId.messageOn error
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.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.