opened
malgorithms
username_0
The primary issue with the bot, as it works now, is that it requires being logged in as the bot user. You can see in its init function that it takes no credentials but just starts working:

```
bot.init({verbose: false}, function (err) {
  if (!err) {
     // do whatever; it's talking via the CLI to keybase's local service
  }
}
```

It just checks that you're logged in with a `keybase status` and then from then on it fires chat api requests at the same `keybase` from the command line that you would use.

This has a number of issues:

1. You might want to run a bot in a GUI environment where you're simultaneously logged in as yourself, but you have a bot assistant doing other things who isn't you. This also won't bog down your GUI with its activities.

2. You might want to run it in a docker or something, and there's no way to just tell the bot its credentials

3. It would be nice to instantiate multiple bots in the same script, say for talking shit to each other (or more likely, testing!)

4. What if the logged in user switches while they forget they're running the bot?! There's lots of annoying error checking that needs to be done and this can be stripped. IIRC it currently checks before each command or was on the todo list.

Fortunately, Keybase has a new feature. You can run a keybase service in "one off" or "one shot" mode, as Mike calls it. You can:

1. start up your own keybase service by passing it a username and a paper key!
2. then send requests specifically to that service.

So your init would switch to something like this:


```
bot.init({
   username: "chris"
   paper_key: "foo bar car zar...'
  }, function (err) {
  if (!err) {
     // do whatever; now when you make calls you'll be hitting a service logged in as this user
  }
}
```

This really is way better, and as you can imagine you can now write scripts with multiple bots. 

Once this is done, then we can start doing more test-driven work.
Switch to one-shot mode
issue
created
thebearjew
username_1
closed by #10
comment
closed
thebearjew
username_1
issue