-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot-test.js
88 lines (79 loc) · 1.91 KB
/
bot-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const { handleBotMessage, handleWithTimeout } = require('./bot.js')
function testBalance() {
let context = {
text: '/checkBalance a3267bd425bc4495084da6f31496cb726de8974175ce09b4ad3c8a5d34b92a11',
chat: {
id: 370798623
}
}
handleWithTimeout(context, 2000)
.then(r => console.log(r))
.catch(e => console.error(e));
}
function testInfo() {
let context = {
text: '/getNodeInfo https://hlxtest33.net:8085',
chat: {
id: 370798623
}
}
handleWithTimeout(context, 2000)
.then(r => console.log(r))
.catch(e => console.error(e));
}
function testFaucet() {
let context = {
text: '/giveMeMoney a3267bd425bc4495084da6f31496cb726de8974175ce09b4ad3c8a5d34b92a11',
chat: {
id: 370798623
}
}
handleWithTimeout(context, 2000)
.then(r => console.log(r))
.catch(e => console.error(e));
}
function testTx() {
let context = {
text: '/getTxInfo 00007a9e9b3f6fef265c12e06ad7433017fcd0485ad826d817149f689214adfb',
chat: {
id: 370798623
}
}
handleWithTimeout(context, 2000)
.then(r => console.log(r))
.catch(e => console.error(e));
}
function testHelp() {
let context = {
text: '/pleaseHelpMe',
chat: {
id: 370798623
}
}
handleWithTimeout(context, 2000)
.then(r => console.log(r))
.catch(e => console.error(e));
}
function testStart() {
let context = {
text: '/start',
chat: {
id: 370798623
}
}
handleWithTimeout(context, 2000)
.then(r => console.log(r))
.catch(e => console.error(e));
}
if (module === require.main) {
setTimeout(() => testHelp(), 1000);
setTimeout(() => testTx(), 1000);
setTimeout(() => testFaucet(), 1000);
setTimeout(() => testStart(), 1000);
setTimeout(() => testInfo(), 1000);
setTimeout(() => testBalance(), 1000);
//testTx();
//testFaucet();
//testInfo();
//testBalance();
}