MCPcopy Create free account
hub / github.com/codemistic/Web-Development / MessageParser

Class MessageParser

Modern-Portfolio/src/Chatbot/MessageParser.js:2–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1// MessageParser starter code in MessageParser.js
2class MessageParser {
3 constructor(actionProvider) {
4 this.actionProvider = actionProvider;
5 }
6
7 parse(message) {
8 const lowerCaseMessage = message.toLowerCase();
9
10 if (lowerCaseMessage.includes('hi')) {
11 this.actionProvider.greet();
12 }
13
14 if(lowerCaseMessage.includes('yes')) {
15 this.actionProvider.vedio();
16 }
17
18 if(lowerCaseMessage.includes('email')) {
19 this.actionProvider.Face();
20 }
21
22 if(lowerCaseMessage.includes('address')) {
23 this.actionProvider.faceUse();
24 }
25
26 if(lowerCaseMessage.includes('social')) {
27 this.actionProvider.colab();
28 }
29
30 if(lowerCaseMessage.includes('linkedin')) {
31 this.actionProvider.colabUse();
32 }
33
34 if(lowerCaseMessage.includes('twitter')) {
35 this.actionProvider.codeP();
36 }
37
38 if(lowerCaseMessage.includes('facebook')) {
39 this.actionProvider.facebook();
40 }
41
42 if(lowerCaseMessage.includes('instagram')) {
43 this.actionProvider.instagram();
44 }
45
46 if(lowerCaseMessage.includes('phone')) {
47 this.actionProvider.phone();
48 }
49
50 if (lowerCaseMessage.includes('good')) {
51 this.actionProvider.feedback();
52 }
53
54 if (lowerCaseMessage.includes('bad')) {
55 this.actionProvider.feedback();
56 }
57 }
58}
59
60export default MessageParser;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected