-
Notifications
You must be signed in to change notification settings - Fork 115
/
app.js
45 lines (37 loc) · 1.07 KB
/
app.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
const Bot = require('./modules/bot');
const process = require('process');
require('./modules/date-format');
class Plugin extends Bot {
constructor () {
super();
}
async run () {
const now = new Date().Format('M/d h:m:s');
await this.sendImage('assets/geekbot.png');
// 发送环境配置信息
const CONF_DATA = `
## GeekBot Secrets Dump
> 备份导出您的项目\`secrets\`设置数据
## 1. \`bot_api\`
\`\`\`
${process.env.bot_api}
\`\`\`
## 2. \`caiyun_gps\`
\`\`\`
${process.env.secrets_caiyun_gps}
\`\`\`
## 2. \`caiyun_key\`
\`\`\`
${process.env.secrets_caiyun_key}
\`\`\`
> 导出时间:${now}
> https://github.com/im3x/GeekBot`;
const f = await this.uploadFile("配置数据备份.md", Buffer.from(CONF_DATA));
await this.sendFile(f);
await this.sendMarkdown("🤖 Hello! GeekBot!\n> 项目地址:[@GeekBot](https://github.com/im3x/GeekBot)\n> 启动时间:" + now);
// test env
// const $f = await this.uploadFile("env.txt", new Buffer(JSON.stringify(process.env)));
// await this.sendFile($f);
}
}
new Plugin().run();