1 | let superscript = require('.').default;
|
2 |
|
3 | let data = {
|
4 | topics: {
|
5 | random2: {
|
6 | name: 'random2',
|
7 | flags: {
|
8 | keep: 'keep'
|
9 | },
|
10 | keywords: ['greetings'],
|
11 | filter: null,
|
12 | gambits: ['3qCMA1zN', 'QD4PT6Re', 'EYzbhlLo', 'PUGz7VnJ']
|
13 | }
|
14 | },
|
15 | gambits: {
|
16 | '3qCMA1zN': {
|
17 | trigger: {
|
18 | flags: {},
|
19 | filter: null,
|
20 | question: false,
|
21 | raw: 'new conversation',
|
22 | clean: 'new conversation'
|
23 | },
|
24 | replies: ['ZYcf1ZjD'],
|
25 | conditional: null,
|
26 | conversation: null,
|
27 | topic: 'random2'
|
28 | },
|
29 | QD4PT6Re: {
|
30 | trigger: {
|
31 | flags: {},
|
32 | filter: null,
|
33 | question: false,
|
34 | raw: '10',
|
35 | clean: '10'
|
36 | },
|
37 | replies: ['u2nPKPyl'],
|
38 | conditional: null,
|
39 | conversation: ['ZYcf1ZjD'],
|
40 | topic: 'random2'
|
41 | },
|
42 | EYzbhlLo: {
|
43 | trigger: {
|
44 | flags: {},
|
45 | filter: null,
|
46 | question: false,
|
47 | raw: '15',
|
48 | clean: '15'
|
49 | },
|
50 | replies: ['krqpKkJD'],
|
51 | conditional: null,
|
52 | conversation: ['ZYcf1ZjD'],
|
53 | topic: 'random2'
|
54 | },
|
55 | PUGz7VnJ: {
|
56 | trigger: {
|
57 | flags: {},
|
58 | filter: null,
|
59 | question: false,
|
60 | raw: '__ask_age',
|
61 | clean: '__ask_age'
|
62 | },
|
63 | replies: ['fp52b5OT', 'QZknvPs6'],
|
64 | conditional: null,
|
65 | conversation: null,
|
66 | topic: 'random2'
|
67 | }
|
68 | },
|
69 | replies: {
|
70 | ZYcf1ZjD: {
|
71 | string: '{@__ask_age}',
|
72 | filter: null,
|
73 | keep: false
|
74 | },
|
75 | u2nPKPyl: {
|
76 | string: 'kid',
|
77 | filter: null,
|
78 | keep: false
|
79 | },
|
80 | krqpKkJD: {
|
81 | string: 'boy',
|
82 | filter: null,
|
83 | keep: false
|
84 | },
|
85 | fp52b5OT: {
|
86 | string: 'What is your age?',
|
87 | filter: null,
|
88 | keep: false
|
89 | },
|
90 | QZknvPs6: {
|
91 | string: 'How old are you?',
|
92 | filter: null,
|
93 | keep: false
|
94 | }
|
95 | },
|
96 | checksums: {
|
97 | 'engine/chat/greetings.ss': '99efb4bbed96fb178004942e771e70abaf1e3801'
|
98 | },
|
99 | version: 1
|
100 | };
|
101 |
|
102 | const options = {
|
103 | factSystem: {
|
104 | clean: false
|
105 | },
|
106 | importJSON: data
|
107 | };
|
108 |
|
109 | console.log(superscript);
|
110 |
|
111 | superscript.setup(options, (err, botInstance) => {
|
112 | if (err) {
|
113 | console.error(err);
|
114 | }
|
115 | console.log(1);
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | setTimeout(() => {
|
123 | console.log(3);
|
124 | botInstance.directReply(
|
125 | 'uid',
|
126 | 'random2',
|
127 | 'new conversation',
|
128 | (err, reply) => {
|
129 | console.log(4);
|
130 | if (err) {
|
131 | console.error(err);
|
132 | }
|
133 | console.log(reply);
|
134 | }
|
135 | );
|
136 | }, 2000);
|
137 |
|
138 | });
|