1 | const { Keyboard, TextButton, LinkButton, LocationButton, VKPayButton, VKAppButton } = require('../index');
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | new Keyboard([
|
7 | [new TextButton('button 1', 'default')],
|
8 | [new TextButton('button 2', 'primary')]
|
9 | ]);
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | new Keyboard({ inline: true }, [
|
16 | [new TextButton('button 1', 'positive')],
|
17 | [new TextButton('button 2', 'negative')]
|
18 | ]);
|
19 |
|
20 | new Keyboard(
|
21 | [[ new TextButton('button 1', 'default') ]]
|
22 | ).inline();
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | new Keyboard({ one_time: true }, [
|
29 | [new TextButton('button 1', 'default')],
|
30 | [new TextButton('button 2', 'primary')]
|
31 | ]);
|
32 |
|
33 | new Keyboard(
|
34 | [[ new TextButton('button 1', 'default') ]]
|
35 | ).oneTime();
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | new Keyboard([
|
42 | [ new TextButton('button 1', 'positive', ['payload_action']) ],
|
43 | [ new TextButton('button 2', 'negative', ['payload_action', 'argument']) ],
|
44 | [ new TextButton('button 2', 'negative', ['payload_action', ['arg1', 'arg2']]) ]
|
45 | ]);
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | new Keyboard([
|
52 | [ new LocationButton() ],
|
53 | [
|
54 | new VKPayButton('action=transfer-to-group&group_id=1&aid=10')
|
55 | ],
|
56 | [
|
57 | new VKPayButton({ action: 'transfer-to-group', group_id: 1, aid: 1 })
|
58 | ],
|
59 | [
|
60 | new LinkButton('Открыть ссылку', 'https://google.com')
|
61 | ],
|
62 | [
|
63 | new VKAppButton('Открыть приложение', { app_id: 1, owner_id: -1, hash: 'debug' })
|
64 | ]
|
65 | ]);
|
66 |
|