[SOLVED] VE280-Project 2 

30.00 $

Category:

Description

Rate this product

VE280 – Programming & Elem. Data                                  

Structures

Project 2                                                                                  

             DESCRIPTION

The bot keeps waiting for a message. When a message arrives, it attempts to parse it and return a response or just do nothing.

If the message can be parsed into a known command, it will execute the command. The commands are as follows:

course:     find all the courses that contain the keyword instructor:   find all the instructors that contain the keyword help:   show help message time:   show the time when the message was sent stop:   (For group admins only) stop the bot

All commands start with # . A message is regarded as a command only if it starts with # and can be parsed into one of the known commands above. A command is made up of a prefix (#), a command name (shown below), and keywords (optional). Like

Input:

Output:

Sometimes it will admire the message by adding a prefix to the original message. For the prefix, the bot will flip a coin. If the value of the coin is 1 (or head), it will use Respect, otherwise it will use I really admire. The probability of the overall admire action is defined by ADMIRE_ROLL (unit: %). Sample

Input:

Output:

OR