I have a chat bot for an Instant messenger and I am trying to make a math solver for it but it can't send the solution of equation to the Instant messenger, it sends equation instead.
If someone from Instant messenger sends "solve: 2+2", this program should send them "4" not "2+2".
Main problem:
if (parser.getPayload().lower()[:6]=="solve:"):
parser.sendGroupMessage(parser.getTargetID(), str(parser.getPayload()[7:]))
output:
it's sending same input again not the answer of equation
Test: I tested something and that's working properly. If I add this code, program will send solution of equation:
if (parser.getPayload().lower()=="test"):
parser.sendGroupMessage(parser.getTargetID(), str(2 + 2 -3 + 8 * 7))
Output: Working perfectly