Send a topic to your Telegram chat and get back a drafted social post for the platform you choose, with a picture to go with it.
Uses
ImgBB
OpenAI
Stability AI
Telegram
Message a topic, get post copy and a picture back
incomingMessage.When a new message is received. Save it as incomingMessage.brandName to blank.Set brandName to blank.whatYouDo to blank.Set whatYouDo to blank.postPlatform to LinkedIn.Set postPlatform to LinkedIn.pictureStyle to photographic.Set pictureStyle to photographic.postPlatform and save it as platformChoice.Trim postPlatform and save it as platformChoice.knownPlatforms to:Set knownPlatforms to:linkedin
x
instagram
facebook
threadsknownPlatforms doesn't contain platformChoice in lowercaseIf knownPlatforms doesn't contain platformChoice in lowercaseYes
No
No steps
pictureStyle lowercase and save it as styleChoice.Make pictureStyle lowercase and save it as styleChoice.knownStyles to:Set knownStyles to:3d-model
analog-film
anime
cinematic
comic-book
digital-art
enhance
fantasy-art
isometric
line-art
low-poly
modeling-compound
neon-punk
origami
photographic
pixel-art
...knownStyles doesn't contain styleChoiceIf knownStyles doesn't contain styleChoiceYes
No
No steps
chatId to incomingMessage.chat_id.Set chatId to incomingMessage.chat_id.chatId is emptyIf chatId is emptyYes
No
No steps
topicText to blank.Set topicText to blank.messageErrorIf a step below fails, save the error as messageErrorTry
incomingMessage.text and save it as topicText.Trim incomingMessage.text and save it as topicText.On error
isOwnReply to topicText starts with Here is your draft or topicText starts with Picture for your or topicText starts with I could not write that post or topicText starts with Tell me what the post is about.Set isOwnReply to topicText starts with Here is your draft or topicText starts with Picture for your or topicText starts with I could not write that post or topicText starts with Tell me what the post is about.isOwnReply is yesIf isOwnReply is yesYes
No
No steps
topicText is less than 3If the length of topicText is less than 3Yes
chatId.Send a message to chat chatId.Tell me what the post is about - 'we now ship on Saturdays', 'our new opening hours', anything you want written up.No
No steps
topicText to 300 characters (keeping words whole) and save it as cappedTopic.Shorten topicText to 300 characters (keeping words whole) and save it as cappedTopic.brandLine to brandName - whatYouDo.Set brandLine to brandName - whatYouDo.factRules to Everything the post claims about the business must come from the line above or from the topic below. Invent nothing else.Set factRules to Everything the post claims about the business must come from the line above or from the topic below. Invent nothing else.
Never write a statistic, a percentage, a price, a discount, a customer count, a rating, an award, a date or a named partner that you were not given. Never promise a result, a saving, a delivery time or a guarantee.
If the post would need a number you were not given, write it without the number.
Do not name, quote or imply an endorsement from any real person, customer or company.
No medical, legal or financial advice.styleRules to Write in plain language. Short sentences. No hype words, no exclamation marks, no emoji unless the platform is Instagram or Threads, and no more than three hashtags.Set styleRules to Write in plain language. Short sentences. No hype words, no exclamation marks, no emoji unless the platform is Instagram or Threads, and no more than three hashtags.
Open with the point rather than a question. End with one clear thing the reader can do.formatRules to Reply with the post itself and nothing else - no heading, no explanation, no quotation marks around it.Set formatRules to Reply with the post itself and nothing else - no heading, no explanation, no quotation marks around it.
Then, on the very last line, write IMAGE: followed by one sentence describing a picture to run alongside the post. Describe a scene, an object or a setting. Do not describe any real, named or identifiable person, and do not ask for a logo, a brand mark, a chart or any readable text in the picture.postPrompt to Write one social media post for platformChoice.Set postPrompt to Write one social media post for platformChoice.
The business: brandLine
factRules@styleRules@formatRulesThe topic: cappedTopic
.modelResult to nothing.Set modelResult to nothing.modelCallErrorIf a step below fails, save the error as modelCallErrorTry
postPrompt. Save it as modelResult.Ask OpenAI: postPrompt. Save it as modelResult.On error
modelResult to nothing.Change modelResult to nothing.copyRaw to blank.Set copyRaw to blank.copyErrorIf a step below fails, save the error as copyErrorTry
modelResult.response_text and save it as copyRaw.Trim modelResult.response_text and save it as copyRaw.On error
copyRaw to blank.Change copyRaw to blank.copyRaw is emptyIf copyRaw is emptyYes
chatId.Send a message to chat chatId.I could not write that post just now. Send the topic again and I will try once more.No
No steps
postText to copyRaw.Set postText to copyRaw.imageBrief to cappedTopic.Set imageBrief to cappedTopic.copyRaw contains IMAGE:If copyRaw contains IMAGE:Yes
copyRaw by "Split copyRaw by
IMAGE: and save it as copyParts.copyParts and save it as postText.Trim the first item of copyParts and save it as postText.copyParts and save it as briefPart.Trim the last item of copyParts and save it as briefPart.briefPart isn't emptyIf briefPart isn't emptyYes
imageBrief to briefPart.Change imageBrief to briefPart.No
No steps
No
No steps
postText is emptyIf postText is emptyYes
postText to copyRaw.Change postText to copyRaw.No
No steps
illustrationPrompt to A picture to run alongside a social media post, with no text or lettering anywhere in it and no real, named person in it. The picture: imageBrief truncated to 500 characters using ... as the ellipsis (keeping words whole).Set illustrationPrompt to A picture to run alongside a social media post, with no text or lettering anywhere in it and no real, named person in it. The picture: imageBrief truncated to 500 characters using ... as the ellipsis (keeping words whole).pictureRef to blank.Set pictureRef to blank.drawingErrorIf a step below fails, save the error as drawingErrorTry
illustrationPrompt. Save it as generated.Generate an image of illustrationPrompt. Save it as generated.text, letters, words, captions, watermark, signature, logo, brand mark, real person, celebrity, chart, infographicgenerated.document_ref and save it as pictureRef.Trim generated.document_ref and save it as pictureRef.On error
pictureRef to blank.Change pictureRef to blank.pictureUrl to blank.Set pictureUrl to blank.pictureRef isn't emptyIf pictureRef isn't emptyYes
hostingErrorIf a step below fails, save the error as hostingErrorTry
hosted.Upload an image. Save it as hosted.hosted.url and save it as pictureUrl.Trim hosted.url and save it as pictureUrl.On error
pictureUrl to blank.Change pictureUrl to blank.No
No steps
pictureUrl doesn't start with https://If pictureUrl doesn't start with https://Yes
pictureUrl to blank.Change pictureUrl to blank.No
No steps
headerNote to:Set headerNote to::pictureUrl isn't emptyIf pictureUrl isn't emptyYes
chatId.Send a photo to chat chatId.
Photo URL: pictureUrlPicture for your platformChoice post: cappedTopic truncated to 900 characters using "..." as the ellipsis (keeping words whole)No
headerNote to:Change headerNote to:. No picture could be made for this one.postHeader to Here is your draft platformChoice post for brandName@headerNote.Set postHeader to Here is your draft platformChoice post for brandName@headerNote.postHeader plus postText to 3800 characters (keeping words whole) and save it as postMessage.Shorten postHeader plus postText to 3800 characters (keeping words whole) and save it as postMessage.chatId.Send a message to chat chatId.postMessagepictureUrl isn't emptyIf pictureUrl isn't emptyYes
No