From f1f62c22a0b83d37b66fe59ff9070839356fce2f Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 6 Dec 2021 23:48:07 +0800 Subject: [PATCH] move and update the notification configuration doc --- README.md | 44 +++-------------------------------- doc/configuration/slack.md | 23 ++++++++++++++++++ doc/configuration/telegram.md | 32 +++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 41 deletions(-) create mode 100644 doc/configuration/slack.md create mode 100644 doc/configuration/telegram.md diff --git a/README.md b/README.md index 9bb677f0e..f5ce37477 100644 --- a/README.md +++ b/README.md @@ -139,48 +139,10 @@ Note on date formats, the following date formats are supported: * RFC822, which looks like `02 Jan 06 15:04 MST` * You can also use `2021-11-26T15:04:56` -## Advanced Setup +## Advanced Configuration -### Setting up Telegram Bot Notification - -Open your Telegram app, and chat with @botFather - -Enter `/newbot` to create a new bot - -Enter the bot display name. ex. `your_bbgo_bot` - -Enter the bot username. This should be global unique. e.g., `bbgo_bot_711222333` - -Botfather will response your a bot token. *Keep bot token safe* - -Set `TELEGRAM_BOT_TOKEN` in the `.env.local` file, e.g., - -```sh -TELEGRAM_BOT_TOKEN=347374838:ABFTjfiweajfiawoejfiaojfeijoaef -``` - -For the telegram chat authentication (your bot needs to verify it's you), if you only need a fixed authentication token, -you can set `TELEGRAM_AUTH_TOKEN` in the `.env.local` file, e.g., - -```sh -TELEGRAM_BOT_AUTH_TOKEN=itsme55667788 -``` - -Run your bbgo, - -Open your Telegram app, search your bot `bbgo_bot_711222333` - -Enter `/start` and `/auth {code}` - -Done! your notifications will be routed to the telegram chat. - -### Setting up Slack Notification - -Put your slack bot token in the .env.local file: - -```sh -SLACK_TOKEN=xxoox -``` +- [Setting up Telegram notification](./doc/configuration/telegram.md) +- [Setting up Slack notification](./doc/configuration/slack.md) ### Synchronizing Trading Data diff --git a/doc/configuration/slack.md b/doc/configuration/slack.md new file mode 100644 index 000000000..3c169ce9d --- /dev/null +++ b/doc/configuration/slack.md @@ -0,0 +1,23 @@ +### Setting up Slack Notification + +Put your slack bot token in the .env.local file: + +```sh +SLACK_TOKEN=xxoox +``` + +And add the following notification config in your `bbgo.yml`: + +```yaml +--- +notifications: + slack: + defaultChannel: "bbgo-xarb" + errorChannel: "bbgo-error" + + # routing rules + routing: + trade: "$silent" + order: "$slient" + submitOrder: "$slient" +``` \ No newline at end of file diff --git a/doc/configuration/telegram.md b/doc/configuration/telegram.md new file mode 100644 index 000000000..8162aadf6 --- /dev/null +++ b/doc/configuration/telegram.md @@ -0,0 +1,32 @@ +### Setting up Telegram Bot Notification + +Open your Telegram app, and chat with @botFather + +Enter `/newbot` to create a new bot + +Enter the bot display name. ex. `your_bbgo_bot` + +Enter the bot username. This should be global unique. e.g., `bbgo_bot_711222333` + +Botfather will response your a bot token. *Keep bot token safe* + +Set `TELEGRAM_BOT_TOKEN` in the `.env.local` file, e.g., + +```sh +TELEGRAM_BOT_TOKEN=347374838:ABFTjfiweajfiawoejfiaojfeijoaef +``` + +For the telegram chat authentication (your bot needs to verify it's you), if you only need a fixed authentication token, +you can set `TELEGRAM_AUTH_TOKEN` in the `.env.local` file, e.g., + +```sh +TELEGRAM_BOT_AUTH_TOKEN=itsme55667788 +``` + +Run your bbgo, + +Open your Telegram app, search your bot `bbgo_bot_711222333` + +Enter `/start` and `/auth {code}` + +Done! your notifications will be routed to the telegram chat. \ No newline at end of file