I'm creating a bot using Circuit JS SDK. And I want that users could interact with bot by sending slash commands (eg. "/help"). Does Circuit supports auto-sending command by clicking on command (like Telegram does)? And if it's not, is there something that I can use instead?
The Circuit JS SDK does not support slash commands, maybe in the future. But you can use the mention
event or the itemAdded
event and parse the content yourself.
Some apps don't want to use slash commands but instead pass the text into an NLP/AI service such as DialogFlow when the bot is being mentioned. Others use custom commands such as stream rtsp://
, or
Here are a few examples: - listen for mention event with custom command:https://github.com/circuit/drone-bot/blob/master/index.js#L76 or https://github.com/circuit/trivia-quiz/blob/master/app.js#L561 - listen for addItem event and pass content to NLP: https://github.com/circuit/support-bot/blob/master/server.js#L68