The robot you just produced is ok, but it’s not so interesting.
The basic parts are there, therefore you can exchange all of them on and expand them easily.
The portion to pay attention to when customizing are the when /command/i contours, plus the text between your prices throughout the answer.txt contours. These represent the inputs your bot allows, together with meages it directs back as reactions.
Therefore, should you wanted to state something else as an answer toward /greet command, you’d alter the worth of reply.text underneath the greet command line ( when /greet/i ). Here’s a variation you could try:
Right here, I’ve produced a selection with a few different ways to say hello, after which extra a person to the meage at random when using the sample process.
Turning the bot into things amazing
You can add as many commands, replies, featuring your bot as you like. The majority of it’s creative imagination, and many Googling as you get. If you wish to read lots of things being applicable to this bot, start out with read Ruby the difficult method of getting to grips with all the requirements in the code. With some rehearse and a healthier reliance on StackOverflow, you’ll be able to:
- Connect other APIs to pull facts from sources like Airtable, Slack, R, or Twitter. And here the really interesting function comes in — you can generate a bot that acts as a conversational screen to a collection of facts or attributes, like a bot that comes back google search results from Twitter or blogs to Slack.
- Shop user input in a databases. You could build a Telegram robot that provides automatic service to people or responds to inquiries, and storage her email addrees in a database. The Sequel treasure makes it easy to create, compose, change, and study sources. Continue reading “The robot you just produced is ok, but it’s not so interesting.”