Open Yappio

SDKs coming soon

The local simulator: test a bot without a server

Writing a bot should start with writing a bot, not with setting up accounts. The Yappio local simulator is a coming-soon tool that stands in for a server on your own computer, so you can type a command, see the reply and press the button in seconds. It is not published yet; this page describes what it is meant to do and how to test today.

Last updated .

What problem it solves

Most bot platforms need an account, an application, a test community and an invitation before the first command works. Each of those is a place to get stuck, and each makes automated testing harder. A simulator removes them so the first feedback comes in seconds.

What it is meant to include

The simulator is coming soon as a small local program with a plain interface.

  • A fake server with a channel and a few made-up members.
  • A message box that accepts slash commands with autocomplete.
  • Rendered replies, buttons and modals that you can interact with.
  • A log of the events your bot received and the calls it made.

Testing today

Until the simulator ships, create a free account, make a private test server, create an app in the Developer Portal at https://yappio.chat/developers/applications and install it there with OAuth2. Point the app's interactions endpoint at a tunnel to your computer and your handlers run against real signed requests.

Testing without a window

The simulator is also meant to be driven by code. A test could send a command, read the reply and press a button, which would make it possible to run bot tests in ordinary continuous integration with no network access.

Writing tests with it

A simulator that you can script is also a test harness. The idea is that you describe a conversation, such as a person running a command and pressing a button, and check what your bot replied. Because nothing leaves your computer, those tests can run in a few seconds and in any automated checks you already use.

That also makes mistakes cheaper. A command that fails in the simulator costs you a few lines of output instead of a confused message in a real community.

Moving from the simulator to a real server

The goal is that a bot which works in the simulator needs very little change to work on a server: swap the connection, supply a token, and install the bot. What the simulator cannot show you is how real people behave, how a busy room feels, and how your bot copes with limits, so plan to try it with a small group first.

The simulator is coming soon and is not published yet. If you would like to hear when it is ready, say so when you write to [email protected].

Keeping secrets out of your code

Even in a simulator, get in the habit of reading tokens and keys from the environment instead of writing them into your source. The simulator needs no real credentials, but the habit means the code you move to a real server contains no secrets to leak. Keep a sample configuration file with empty values, add the real one to your ignore list, and do not paste tokens into chats or issue reports.

What it cannot tell you

A simulator cannot reproduce every behaviour of a live server, such as rate limits, permissions set by a server owner or the load of a busy community. It will be a fast first check and not a replacement for trying a bot with real people.

Questions

Does the simulator need an internet connection?

It is meant to run entirely on your computer. It is not published yet.

Will it work in automated tests?

Driving it from code is a goal for it, once it is published.

When can I download it?

It is coming soon. In the meantime test against a private server you own.

Related

Start talking in a minute

Make a free account, open a server or join one with an invite link. It works in the browser, nothing to install.