What’s so new in EH Forwarder Bot 2 (and its modules)
Tags: ehforwarderbot, python
Published: 2019-10-06 17:17:53

---
title: What’s so new in EH Forwarder Bot 2 (and its modules)
published: true
date: 2018-02-05 18:09:43 UTC
tags: EH Forwarder Bot,Python
canonical_url: https://blog.1a23.com/2018/02/06/whats-so-new-in-eh-forwarder-bot-2-and-its-modules/
---

> EH Forwarder Bot is an extensible chat tunneling framework that allow users to send and receive messages from multiple IM platforms at one stop, and ultimately manage their accounts remotely.  
> [https://github.com/blueset/ehForwarderBot](https://github.com/blueset/ehForwarderBot)

After almost a whole year, EH Forwarder Bot 2 has finally more or less finalized its features and structures. Most of the modules have also entered beta stage together with the framework. This update will be a lot different from the previous version, and as suggested by the semantic versioning, it will not be compatible with the previous version.

So, I think it should be the time to introduce about the new features in EFB v2.

## The framework

The EFB framework has been completely redesigned in a more reasonable and open fashion. Now, instead of having everything at one repository, all modules can be and should be installed separately from the framework, as to keep every module “Simple and Stupid” (although it might not always be the case). This is also to encourage more developers to make their own modules and doesn’t look being excluded.

Every piece of information delivered between channels are abstracted to objects, and being verified before sent to the other channel. The verification process checks the minimum amount of information required by each message type and ensure that they are correctly filled by the sending channel. Features like message editing and removal has been included in the messaging protocol as well.

We also introduced the status as an alternative type of information that is delivered between channels. It is usually used to inform the master channel about changes happened in the chat list and about group members

Regarding permanent storages, 2.0 uses a standard to store all configurations and necessary data. The storage is specific to the profile it’s running on, which will be introduced later, and each module has dedicated place for its own data. In this way, the data storage is separated from the modules, which made profiles possible.

In EFB v2, separate profiles can be used to run different instances of EFB. As their data are stored separately, those instances runs independent from each other. If you want to have multiple accounts from the same service that you want to manage, that’s not a problem as well. EFB v2 allow users to identify each instance with an instance ID, which can be used to identify different accounts from the same platform/channel.

While running, the framework itself exists as an `coordinator`, which maintains all instances and polling threads of channels enabled, and manages the delivery of information between channels.

Besides that, the coordinator also manages all enabled middlewares, which is another new component introduced in version 2. Middlewares are designed to intercept messages and statuses sent between channels. They can make changes to messages or even block messages from delivery. Furthermore, as middlewares are easier to implement and has rather less restrictions than channels, it also can be used for other purposes such as automated messaging, chat bot, analysis, monkey patching, etc.

With all the new features of the framework, the project is also better documented with explanations and API docs in more detail. The new documentation is written with Sphinx, the de facto standard of Python documentations. Also, all modules maintained by me are well commented to serve as examples.

Furthermore, the docs, together with the prompts of the framework, is translated into multiple languages by the community.

## Modules

Apart from refactored to adapt to the new framework, all modules maintained by me were separated from the frameworks repository. Besides, the 2 modules with large code volume are refactored for better clearity. Those modules have also joined the community localization project.

### EFB Telegram Master

New features:

- Message editing, and indicate removal with special prefix.
- ‎Manual chat linking to groups and channels.
- ‎Update chat name and profile picture to the group/channel linked
- ‎Truncation of long messages and send full messages as file
- Better processing of Telegram exceptions.

### EFB WeChat Slave

- Better prompt when certain messages or message types are not supported by the Web WeChat API.
- ‎Migration to `wxpy` for an OO API wrapping with (supposedly) better fake permanent ID mechanism.
- Further minor changes that improves

### EFB Facebook Messenger Slave

EFMS is a newly written slave channel that provides a good preview of what EFB aims to do to power users that are not familiar with WeChat. This channel was based on the Facebook Messenger Web client, and offers a basic support to chats and messages.

### EFB GPG Middleware

Encrypt and decrypt all text messages if applicated. It might not seem to be that useful, at it’s made as an example of middleware.

## In the end…

EFB framework and most of its frameworks are still in beta stage. If you are a poweruser and finds any module that meeds your need, we welcome you to be a beta tester. Or if your are good at Python, you are also welcomed to write your own modules. Documentation is available [here](https://ehforwarderbot.readthedocs.io/en/latest/). If you have any question, feel free to comment here.

The post [What’s so new in EH Forwarder Bot 2 (and its modules)](https://blog.1a23.com/2018/02/06/whats-so-new-in-eh-forwarder-bot-2-and-its-modules/) appeared first on [1A23 Blog](https://blog.1a23.com).