E5 subscription is a subscription for developers, as long as the related API is called, it may be renewed
Calling [Outlook ReadMail API](https://docs.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&tabs=http) to renew, does not guarantee the renewal effect.
## Usage
1. Type `/bind` in the robot dialog
2. Click the link sent by the robot and register the Microsoft application, log in with the E5 master account or the same domain account, and obtain `client_secret`. **Click to go back to Quick Start**, get `client_id`
3. Copy `client_secret` and `client_id` and reply to bot in the format of `client_id(space)client_secret`
(Pay attention to spaces)
4. Click on the authorization link sent by the robot and log in with the `E5` master account or the same domain account
5. After authorization, it will jump to `http://localhost/e5sub……` (will prompt webpage error, just copy the link)
6. Copy the link, and reply `link(space)alias (used to manage accounts)` in the robot dialog
For example: `http://localhost/e5sub/?code=abcd MyE5`, wait for the robot to bind and then complete
Download the binary files of the corresponding system on the [Releases](https://github.com/rainerosion/E5SubBot/releases) page and upload it to the server
Download the source code and install the GO environment
```shell
go env -w CGO_ENABLED=1
go build
```
## Configuration
Create `config.yml` in the same directory, encoded as `UTF-8`
Configuration Template:
```yaml
bot_token: YOUR_BOT_TOKEN
socks5: 127.0.0.1:1080
notice: "first line\nsecond line"
admin: 66666,77777,88888
errlimit: 5
cron: "1 */3 ** *"
bindmax: 3
dbfile: "e5sub.db"
```
`bindmax`, `notice`, `admin`, `errlimit` can be hot updated, just update `config.yml` to save.
| Configuration | Explanation|
| ---- | ---- |
| bot_token | Change to your own `BotToken` |
| socks5 | `Socks5` proxy,if you do not need ,you should delete it. For example: `127.0.0.1:1080` |
|notice|Announcement. Merged into `/help`|
|admin|The administrator's `tgid`, go to https://t.me/userinfobot to get it, separated by `,`; Administrator permissions: manually call the task, get the total feedback of the task|
|errlimit|The maximum number of errors for a single account, automatically unbind the single account and send a notification when it is full, without limiting the number of errors, change the value to a negative number `(-1)`; all errors will be cleared after the bot restarts|
|cron|API call frequency, using `cron` expression|