Discord Notifications

From Haasonline Software Wiki
Jump to: navigation, search

This page is a walkthrough guide for connecting the Haasonline Trade Server to Discord. Once connected to the Discord server, HTS will create several channels and push your notifications to those channels. These notifications can come from manual orders or bots.


Warning, do not connect the bot to an existing server. The bot will manage the channels and removed unknown/obsolete ones.

Notification overview

Below is a list of the currently available notifications that can be pushed from HTS to Discord.

  • Completed orders (bot & manual orders through HTS)
  • Cancelled orders (bot & manual orders through HTS)
  • Historical orders (data from API)

All Bots

  • Activating/Deactivating
  • Trade amount error
  • Coin/Funds position switch
  • Order execution.

Specific

  • Trade Bots - Safety triggered.
  • Accumulation Bots - Deactivated by max amount.
  • Crypto Index Bots - Stop-Loss triggered.
  • Email Bot - Stop-Loss triggered.
  • Email Bot - Email matched.
  • Flash Crash Bot - Out of range by x%.
  • Flash Crash Bot - Safety activated.
  • Flash Crash Bot - Follow The Trend deactivated.
  • Order Bot - Order triggered.
  • Inter-Exchange Arbitrage Bot - Deactivated by max amount.

Message Profile

Each bot has its own message profile than can ignore or push notifications. To edit a Trade Bots message profile

  • Open the bot and click on “Message Profile” under the Quick Links
  • Open the context menu on the bot page, list or widget and click on “Message Profile.”

To edit a Custom Bots message profile

  • Open the custom bot and click on “Message Profile” under the options dropdown.
  • Open the context menu on the bot page, list or widget and click on “Message Profile.”


Server Guide

  1. Open Discord and create a new server
    DiscordWelcome.png
  2. Select “Create a Server” and enter a server name.
  3. Open the “Server Settings”
    DiscordServerSettings.png
  4. Go to “Roles” and create a new role.
    DiscordRoles.png
  5. Enter a name for the new role. E.g., “Bot”
  6. Enable the following setting:
    Manage Channels
    Manage Messages
  7. Save the changes and close the settings window.
  8. Open the discord app settings.
    DiscordAppSettings.png
  9. Go to “Appearance” and enable “Developer Mode.”
    DiscordAppearanceSettings.png
  10. Close the settings page.

Creating a bot

  1. Go to https://discordapp.com/developers/applications/me and click on “New App.”
  2. Enter an “App Name” and click on “Create App.”
  3. Scroll down to “Bot” and click on “Create Bot User.”
  4. Copy the following link and replace CLIENTID with your client ID. https://discordapp.com/oauth2/authorize?client_id=CLIENTID&scope=bot
    DiscordClientID.png
  5. Open the link with the replaced CLIENTID and assign the Bot to the server you created in discord.
  6. Right-click on the bot user and add the created role
    DiscordBotUserRole.png

Adding the bot to HTS

  1. Open the bot on https://discordapp.com/developers/applications/me
  2. Scroll down to “Bot” and click on “click to reveal” next to Token
    DiscordReveal.png
  3. In HTS, Copy and paste this token in the “Discord OAuth Token.” (Settings -> Notification tab)
  4. Open discord and go to the created server.
  5. Right-click on the server name and select “Copy ID.”
    DiscordBotServer.png
  6. In HTS, Paste this in the “Server ID” field in HTS. (Settings -> Notification tab)
  7. Save the settings. The bot will connect and create channels. A welcome message will be posted in #general.