To imagine how a bot works , the easiest thing is to compare it to a physical robot. Unlike the latter, it does not consist of pieces of machinery such as screws, nuts, plates and cables, but of code . The code contains the commands and instructions that tell the bot how to actively or reactively communicate with human users, systems, or other bots ..
Bot design can be very simple, but complex code and artificial intelligence are also implemented in modern bots , which sometimes can barely be distinguished from a person on social media. Nowadays, programming a bot is within the reach of anyone, even the most layman, thanks to the many tools and interfaces available online designed to create simple and complex bots . For example, Twitter gives you the option to create your own chatbots to tweet, retweet, and like.
The following snippet has been taken from the code of a chatbot . In this example, the bot is based on the XML-based AIML markup language , which is often used to program them.