1 | import { BaseComponent } from '@maildots/sdk';
|
2 | import { Message } from '@maildots/sdk';
|
3 | import { Intent } from '@maildots/sdk';
|
4 |
|
5 | import { SayHello } from './SayHello';
|
6 | import { Reply } from './Reply';
|
7 |
|
8 | class Index extends BaseComponent {
|
9 |
|
10 | constructor() {
|
11 | super();
|
12 | }
|
13 |
|
14 | async onNewMessage(message: Message)
|
15 | {
|
16 | console.log(message)
|
17 | }
|
18 |
|
19 | async onInstall(accountAddress: string)
|
20 | {
|
21 | console.log('onInstall')
|
22 | let sayHello = new SayHello();
|
23 | let args = new SayHello.Args(accountAddress);
|
24 | sayHello.execute(args);
|
25 | }
|
26 |
|
27 | async onUninstall(accountAddress: string)
|
28 | {
|
29 | console.log('onUninstall')
|
30 | }
|
31 |
|
32 | async onCommand(command: string, message: Message)
|
33 | {
|
34 | console.log('onCommand')
|
35 | let reply = new Reply();
|
36 | let args = new Reply.Args(message);
|
37 | reply.execute(args);
|
38 | }
|
39 |
|
40 | async onCall(command: string, message: Message)
|
41 | {
|
42 | console.log('onCall')
|
43 | let reply = new Reply();
|
44 | let args = new Reply.Args(message);
|
45 | reply.execute(args);
|
46 | }
|
47 |
|
48 | async onInteraction(input_id: string, message: Message, inputs: Map<string, string>)
|
49 | {
|
50 | console.log('onInteraction')
|
51 | let reply = new Reply();
|
52 | let args = new Reply.Args(message);
|
53 | reply.execute(args);
|
54 | }
|
55 | }
|
56 |
|
57 | let index = new Index();
|