功能:将crisp消息转发到telegram,通过telegram回复crisp消息。
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
debug: true
redis:
host: localhost:6379
db: 0
password: ''
cacheTime: 24
crisp:
identifier: 049sk12f-8349-8274-9d91-f21jv91kafa7 #的 Crisp Marketplace 插件 ID
key: 078f2106a5d89179gkqn38e5e82e3c7j30ajfkelqnvd874fb2378573499ff505 # 你的 Crisp Marketplace 插件秘钥
telegram:
key: #你的Bot Token
admins:
- 93847124
上传执行程序和配置文件
创建守护:
vi /etc/systemd/system/crisp.service
添加如下内容:
[Unit]
Description = crisp
After = network.target
Wants = network.target
[Service]
WorkingDirectory = /root/crispbot/
ExecStart = /root/crispbot/crisp_tg_bot
Restart = on-abnormal
RestartSec = 5s
KillMode = mixed
StandardOutput = null
StandardError = syslog
[Install]
WantedBy = multi-user.target
保存、启动
systemctl daemon-reload
systemctl start crisp
#检查是否启动成功
systemctl status crisp
#设置开机自启
systemctl enable crisp
- 注册 https://app.crisp.chat/initiate/signup
- 前往 MarketPlace, 需要重新注册账号 https://marketplace.crisp.chat/
- 点击 New Plugin,选择 Private,输入名字以及描述。会获得开发者ID和Key。
- 需要Production Key,点击 Ask a production token,再点击Add a Scope。
- 需要 2 条read和write权限:
website:conversation:sessions
和website:conversation:messages
- 保存后即可获得ID和Key,此时点击右上角 Install Plugin on Website 即可。