ehforwarderbot2.0搭建小记
EH Forwarder Bot 是一个可扩展的聊天平台隧道 Bot 框架,目前支持在 Telegram 上收发微信和facebook,未来计划支持更多平台
用了几个月的ehForwarderBot,真有点离不开了 偶然发现2.0beta很久以前已经发布了,就开始折腾了
以下内容均基于ubuntu16.04
升级python到3.6
一般情况下,vps服务商均会预装python 使用python -V
或python3 -V
指令,检查python版本
如果大于等于3.6,跳过此步骤
直接编译安装
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
xz -d Python-3.6.5.tar.xz
tar xvf Python-3.6.5.tar
cd Python-3.6.5
./configure
make && make install
通常情况下 python3.6 -V
已经可以直接输出了
创建软链接
rm /usr/bin/python3
ln -s /usr/local/bin/python3.6 /usr/bin/python3
现在执行python3 -V
理应输出python3.6.5
2018年7月6日更新
安装完成后需要删除原来的python3,否则pip会报错
apt remove python3
安装依赖
apt install ffmpeg libmagic-dev libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev libtool python-setuptools python3-pip
pip3 install pillow
也不知道依赖是多了还是少了
以及编译安装libwebp
apt install gcc make autoconf automake libtool
git clone https://github.com/webmproject/libwebp.git
cd libwebp
./autogen.sh
./configure
make && make install
安装efb三件套
pip3 install ehforwarderbot
pip3 install efb-telegram-master
pip3 install efb-wechat-slave
配置efb
创建配置文件
cd ~
mkdir -p .ehforwarderbot/profiles/default
mkdir -p .ehforwarderbot/profiles/default/blueset.telegram
写入配置文件
vim .ehforwarderbot/profiles/default/config.yaml
token: "12345678_abcdefg......."
admins:
- 00000000
master_channel: "blueset.telegram"
slave_channels:
- "blueset.wechat"
admins中填入你的telegram id
vim .ehforwarderbot/profiles/default/blueset.telegram/config.yaml
token: "12345678:1a2b3c4d5e6g7h8i9j"
admins:
- 00000000
# API tokens required for speech recognition
speech_api:
# Microsoft (Bing) speech recognition token
# API key can be obtained from
# https://azure.microsoft.com/en-us/try/cognitive-services/
bing: "VOICE_RECOGNITION_TOKEN"
# Baidu speech recognition token
# API key can be obtained from
# http://yuyin.baidu.com/
baidu:
app_id: 123456
api_key: "API_KEY_GOES_HERE"
secret_key: "SECRET_KEY_GOES_HERE"
启动efb
ehforwarderbot