Send /note to save something word for word in Baserow, and /find to read your notes back in the same chat.
Uses
Baserow
Telegram
Keep notes in Telegram, stored in Baserow
message.When a new message is received. Save it as message.notesTableId to blank.Set notesTableId to blank.maxNotesShown to 10.Set maxNotesShown to 10.notesShown to maxNotesShown multiplied by 1.Set notesShown to maxNotesShown multiplied by 1.notesShown is less than 1If notesShown is less than 1Yes
No
No steps
chatId to message.chat_id.Set chatId to message.chat_id.messageText to blank.Set messageText to blank.noTextErrorIf a step below fails, save the error as noTextErrorTry
message.text and save it as messageText.Trim message.text and save it as messageText.On error
This message carried no text, so there was nothing to do..Show in the output: This message carried no text, so there was nothing to do..messageText is emptyIf messageText is emptyYes
No
No steps
messageText by a space and save it as words.Split messageText by a space and save it as words.words[0] split by @ lowercase and save it as command.Make the first item of words[0] split by @ lowercase and save it as command.words joined by a space and save it as rest.Trim the items from index 1 onward of words joined by a space and save it as rest.command is not /note and command is not /findIf command is not /note and command is not /findYes
messageText starts with / (ignoring case)If messageText starts with / (ignoring case)Yes
chatId.Send a message to chat chatId.I keep notes for you.
/note <what you want to remember> - saves it word for word
/find <word> - shows the notes containing that word
/find - shows your most recent notesNo
No steps
No
No steps
command is /noteIf command is /noteYes
rest is emptyIf rest is emptyYes
chatId.Send a message to chat chatId.Write the note after /note, for example: /note the spare key is in the blue tinNo
No steps
author to unknown.Set author to unknown.noNameErrorIf a step below fails, save the error as noNameErrorTry
message.from_username and save it as author.Trim message.from_username and save it as author.On error
This sender has no Telegram username..Show in the output: This sender has no Telegram username..saveFailed to false.Set saveFailed to false.saveErrorIf a step below fails, save the error as saveErrorTry
notesTableId.Create a row in table notesTableId.On error
saveFailed to true.Change saveFailed to true.saveFailed is yesIf saveFailed is yesYes
chatId.Send a message to chat chatId.I could not save that note to Baserow, so it has not been kept. Nothing was changed - send it again in a moment.No
No steps
chatId.Send a message to chat chatId.Saved: rest truncated to 200 characters using "…" as the ellipsisNo
notesPage to nothing.Set notesPage to nothing.readFailed to false.Set readFailed to false.readErrorIf a step below fails, save the error as readErrorTry
notesTableId. Save it as notesPage.List rows in table notesTableId. Save it as notesPage.
Rows per page: 200On error
readFailed to true.Change readFailed to true.readFailed is yesIf readFailed is yesYes
chatId.Send a message to chat chatId.I could not read your notes from Baserow just now. Nothing was changed - try again in a moment.No
No steps
savedRows to notesPage.results.Set savedRows to notesPage.results.matches to an empty list.Set matches to an empty list.savedRow in savedRows:For each savedRow in savedRows:rowError If a step below fails, save the error as rowErrorTry
savedRow.Note and save it as noteText.Trim savedRow.Note and save it as noteText.noteText isn't empty and rest is empty or noteText contains rest (ignoring…If noteText isn't empty and rest is empty or noteText contains rest (ignoring…Yes
noteText truncated to 300 characters using … as the ellipsis to the end of matches and save it as matches.Add • noteText truncated to 300 characters using … as the ellipsis to the end of matches and save it as matches.No
No steps
On error
Skipped a row with no text in its Note column..Show in the output: Skipped a row with no text in its Note column..matches is emptyIf matches is emptyYes
emptyReply to You have no notes saved yet. Send /note followed by anything you want to remember..Set emptyReply to You have no notes saved yet. Send /note followed by anything you want to remember..rest isn't emptyIf rest isn't emptyYes
emptyReply to No saved note contains “@rest”.Change emptyReply to No saved note contains “@rest”.No
No steps
chatId.Send a message to chat chatId.emptyReplyNo
No steps
matches from position -notesShown on and save it as shown.Take matches from position -notesShown on and save it as shown.header to Your most recent notes:.Set header to Your most recent notes:.rest isn't emptyIf rest isn't emptyYes
header to Notes containing “@rest”:.Change header to Notes containing “@rest”:.No
No steps
matches is greater than the length of shownIf the length of matches is greater than the length of shownYes
header to header (the latest the length of shown as text of the length of matches as text).Change header to header (the latest the length of shown as text of the length of matches as text).No
No steps
chatId.Send a message to chat chatId.header
shown joined by a new line