Giter VIP home page Giter VIP logo

crisp-telegram-bot's Introduction

Crisp Telegram Bot

功能:将crisp消息转发到telegram,通过telegram回复crisp消息。

编译为linux程序

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build

config.yaml


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

上传到linux服务器

上传执行程序和配置文件

⚠️要上传到能访问telegram的服务器,否则会不能获取到消息

创建守护:

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

附:申请 Crisp 以及 MarketPlace 插件

  1. 注册 https://app.crisp.chat/initiate/signup
  2. 前往 MarketPlace, 需要重新注册账号 https://marketplace.crisp.chat/
  3. 点击 New Plugin,选择 Private,输入名字以及描述。会获得开发者ID和Key。
  4. 需要Production Key,点击 Ask a production token,再点击Add a Scope。
  5. 需要 2 条readwrite权限:website:conversation:sessionswebsite:conversation:messages
  6. 保存后即可获得ID和Key,此时点击右上角 Install Plugin on Website 即可。

crisp-telegram-bot's People

Contributors

selfmakeit avatar

Stargazers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.