Getting Started

To get started we recommend developing a bot on your local development machine or laptop. That can be done quickly and easily using the RingCentral Team Messaging Quick Start below.

Read the Chatbot Quick Start »

Hello World: What a bot looks like

In the Quick Start above you will learn how to create and define bot behavior in just 10 lines of code. Here is the source code needed to create a "Ping Bot" - a bot that responds with "pong" whenever it hears someone say "ping."

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
const createApp = require('ringcentral-chatbot/dist/apps').default

const handle = async event => {
  const { type, text, group, bot } = event
  if (type === 'Message4Bot' && text === 'ping') {
    await bot.sendMessage(group.id, { text: 'pong' })
  }
}
const app = createApp(handle)
app.listen(process.env.RINGCENTRAL_CHATBOT_EXPRESS_PORT)

You can checkout other sample bots to see more complex behaviors.