使用 TediCross。
安装 Node.js#
1
2
| $ curl -sL https://deb.nodesource.com/setup_16.x | bash -
$ apt-get install -y nodejs && node -v
|
安装 TediCross#
1
2
| $ git clone https://github.com/TediCross/TediCross
$ cd TediCross && npm install --production
|
配置 TediCross#
1
2
| $ cp example.settings.yaml settings.yaml
$ vim settings.yaml
|
设置好 Bot Token / 频道 ID 等配置后,继续设置进程守护:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| $ cat > /etc/systemd/system/tedicross.service << EOF
[Unit]
Description=TediCross utility daemon
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
WorkingDirectory=/root/TediCross
ExecStart=/usr/bin/npm start
Restart=always
EOF
|
启动 TediCross#
1
2
| $ systemctl enable tedicross # 注册开机自启
$ systemctl start tedicross
|