You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EFB WeChat Slave Channel is a slave channel for EFB based on [ItChat](https://github.com/littlecodersh/ItChat) and WeChat Web <spanstyle="font-size: 0.5em;">(rev.eng.)</span> API.
4
+
5
+
## Specs
6
+
* Unique name: `eh_wechat_slave`
7
+
* Import path: `plugins.eh_wechat_slave`
8
+
* Class name: `WeChatChannel`
9
+
10
+
## Installation
11
+
### Dependencies
12
+
#### Python dependencies
13
+
```
14
+
itchat
15
+
pymagic
16
+
pillow
17
+
xmltodict
18
+
```
19
+
> **Note**
20
+
> Please refer to [Pillow documentation](https://pillow.readthedocs.io/en/3.0.x/installation.html) for details on installing Pillow.
21
+
22
+
#### Non-python dependencies
23
+
```
24
+
libmagic
25
+
```
26
+
and all other required by Pillow.
27
+
28
+
### Configuration
29
+
* Copy `eh_wechat_slave.py` to "plugins" directory,
30
+
* Append `("plugins.we_wechat_slave", "WeChatChannel")` to `slaves` dict in `config.py`
31
+
* No other configuration is required
32
+
33
+
### Start up
34
+
* Scan QR code with your *mobile WeChat client*, then tap "Accept", if required.
35
+
36
+
## Feature availability
37
+
### Supported message types
38
+
* TO WeChat
39
+
* Text
40
+
* Image (Sticker sent as Image)
41
+
* File
42
+
* FROM WeChat
43
+
* Text
44
+
* Image
45
+
* Sticker
46
+
* Video
47
+
* Location
48
+
* Voice
49
+
* Link
50
+
* Card
51
+
* File
52
+
* System notices
53
+
54
+
### Command messages, Extra Functions
55
+
* Add "Card" as friend or accept friend request
56
+
* Change "alias" of friends
57
+
58
+
## FAQ
59
+
***How do I log in to another WeChat Account?**
60
+
Please remove the `itchat.pkl` file in the EFB root directory, and restart EFB for QR code scanning.
61
+
***Can I log in 2 WeChat accounts concurrently?**
62
+
No. The feature is not yet available to EWS.
63
+
***I want to report a bug.**
64
+
**I have some suggestions.**
65
+
**Can I submit a pull request?**
66
+
All bug reports, suggestions and pull requests are welcomed. Please read through and understand the [Contribution guideline](CONTRIBUTION.md) before submitting.
_Codename_**EH Forwarder Bot** (EFB) is a extensible chat tunnel framework which allows users to contact people from other chat platforms, and ultimately remotely control their accounts in other platforms.
7
+
_Codename_**EH Forwarder Bot** (EFB) is an extensible chat tunnel framework which allows users to contact people from other chat platforms, and ultimately remotely control their accounts in other platforms.
Copy file name to clipboardexpand all lines: docs/installation.md
+10
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,16 @@ EFB framework itself does not require any external modules for it to work. Howev
3
3
4
4
You may follow the following instructions to install dependencies for **all** channels maintained by me, or you may refer to the documentations of each respective channel for their installation instructions.
5
5
6
+
## Storage directory
7
+
8
+
In order to process files and media (pictures, voices, videos, etc.), a storage folder is used to temporarily save and process them. Please create a `storage` folder, if not existing, and give write and read permission to it.
Copy file name to clipboardexpand all lines: docs/slave-channel.md
+36
Original file line number
Diff line number
Diff line change
@@ -90,3 +90,39 @@ Slave channels can send messages that offer the user options to take action. Thi
90
90
Aside from sending a message with "Command" type (refer to the specification in "Message" documentation), the slave channel have to also provide a method for the command to be issued.
91
91
92
92
The method can take any argument of Python's standard data structure, and returns a string which is shown to the user as the result of the action.
93
+
94
+
## Extra functions
95
+
96
+
In some cases, your slave channel may allow the user to achieve extra functionality, such as creating groups, managing group members, etc.
97
+
98
+
You can receive such commands issued in a CLI-like style. An "extra function" method should only take one string parameter aside from `self`, and wrap it with `@extra` decorator from `utils` module. The extra decorator takes 2 arguments: `name`, a short name of the function, and `desc` a description of the function and its usage.
99
+
100
+
> **More on `desc`**
101
+
`desc` should describe what the function does and how to use it. It's more like the help text for an CLI program. Since method of calling an extra function depends on the implementation of the master channel, you should use `{function_name}` as the function name in `desc`, and master channel will replace it with respective name.
102
+
103
+
The method should in the end return a string, which will be shown to the user as the result. Depends on the functionality of the function, it may be just a simple success message, or a long chunk of results.
Copy file name to clipboardexpand all lines: docs/workflow.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -41,9 +41,11 @@ To deliver user's message to a slave channel, you should first gather all the in
41
41
## Slave Channel
42
42
Slave channel has rather less things to do, get and enqueue incoming message, and send message to the platform. Also you may need to generate a list of possible recipients for the Master channel. That should be most of it.
43
43
44
-
# Commands
44
+
##Commands
45
45
Once there's any message from a slave channel that allows the user to take action, the slave channel will enclose detail of actions (namely method names and arguments) into an `EFBMsg` object and send it to the master channel.
46
46
47
47
Master channel will use it's own method to ask the user to make a decision, and with the decision, the master channel will call the respective method of the slave channel with the argument given.
48
48
49
49
The method of slave channel returns a string as the result which is then reflected back to the user.
0 commit comments