Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] end-user-programming "Bots" exploration #145

Open
wants to merge 12 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@szymonkaliski
Copy link
Member

commented Oct 24, 2018

like last time, this probably shouldn't be merged

Below is PR with simple bot stuff, you can go into src/apps/make-bot and run ./make-bot with following arguments:

  • --id - name of the bot, because I'm a lazy engineer, this should be the same as name you give it in the makeBot() function below, this of course could be refactored/fixed
  • --workspace - url for the workspace you're working on - I'm grabbing the current board url from navStack (obviously we could as well have --board but again, lazy)
  • path to the javascript bot file

So for example:

./make-bot --id journaling --workspace capstone://Workspace/CvVAqKkXJiVPftFnoSC3tXAgZMy6jNyUDsmjFFZLLKir/FCh ./bots/journaling.js

I'm supplying two bots, one is fully autonomous -> ./bots/pinterest-organizer.js that will make sure your widgets are in pinterest-like state, and second one: ./bots/journaling.js which creates little widget, that can create time/date stamps on boards (as text widgets), so you can easily date stuff.

As for the bot API, here's what we have right now:

makeBot("bot id", bot => {
   bot.autonomous("Board", () => {
     // do something automatically every time anything on board changes
     //
     // first argument here is type of message sender to react to
   })

  bot.action("Organize", () => {
    // expose ui with "Organize" button that triggers 
    // the code in callback when clicked
    //
    // first argument here is name of action displayed in UI
  })
})

@szymonkaliski szymonkaliski force-pushed the eup-bots branch from b862ff0 to 8e83be4 Nov 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.