Skip to content

Unofficial discord bot to view and control running freqtrade instances

License

Notifications You must be signed in to change notification settings

froggleston/freqtrade-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freqtrade-discord

Unofficial discord bot to view and control running freqtrade instances.

Supported commands

  • /ping
  • /show_config
  • /status
  • /profit
  • /trades
  • /daily
  • /weekly
  • /monthly

Requirements

Run pip3 install -r requirements.txt to install dependencies.

Installation and Setup

Installing the python script

  • Put the ft_bot.py and example.yaml files wherever you like

    • If you want to control a bot locally, the easiest place would be the freqtrade/scripts folder
    • Yes, you can view and control multiple local and remote bots!
    • If you're using a VPS or other remote/cloud server solution, I recommend you use a VPN like tailscale so that you can use the internal VPNed IP addresses that the tailscale service gives you
  • Rename/copy the example.yaml file as a new file, e.g. my_ft_bots.yaml, and edit this new file:

    • Leave the token field at the top of the file empty for now
    • Set a unique simple name for each freqtrade bot instance
    • Set the IP and port information for each freqtrade bot you want to add
      • e.g. if you have a single bot running on localhost:8080, add in localhost as the IP and 8080 as the port
    • Set the username and password information
    • Save the file

Creating the bot in the Discord Developer Portal

  • Create a Discord Developer Portal account

  • Register a New Application as per the discord.py docs, or follow the instructions below:

    • Log in to the Discord Developer Portal
    • Click New Application
    • Give the bot a name, like ft_bot
  • Click on Bot in the left-hand navigation menu, then Add Bot

    • Add a profile picture if you want an easier way to identify your bot in your discord server

    • Under Token:

      • Click Copy
      • Go to your my_ft_bots.yaml file, and paste this token in to the token string field
      • Save your yaml file
      • Do NOT share the bot token with anyone else - it is your bot password
      • You can copy this token only once. If you forget it or do not copy it now, you will need to click Reset Token and replace the token in your yaml file with the new one
    • Go back to the Developer Portal

    • Under Authorization Flow:

      • Public Bot should be UNCHECKED
      • Requires OAuth2 code grant should be UNCHECKED
    • Under Privileged Gateway Intents:

      • Presence Intent should be UNCHECKED
      • Server Members Intent should be UNCHECKED
      • Message Content Intent should be CHECKED
    • Click Save Changes

  • Click the OAuth2 in the left-hand navigation menu, then URL Generator

    • Under Scopes:

      • Click bot
    • Under Bot Permissions:

      • Send Messages should be CHECKED
      • Read Messages/View Channels should be CHECKED
      • Read Message History should be CHECKED
    • Copy the Generated URL at the bottom of the page

  • Open the Generated URL in a browser

    • Check that you're signed in as the correct user for your chosen discord server
    • Select the server you wish to add the bot to in Add to server
    • Confirm that the bot is set to Read Messages and Send Messages
    • Close the tab

Running the ft_bot.py script

  • Run the ft_bot.py script in a screen or tmux
    • python3 ft_bot.py -y my_ft_bots.yaml

Checking the bot is in your discord server

  • Go to your discord server, Server Settings, and Integrations
    • Your new bot should be listed under Bots and Apps - congratulations!
    • Click on Manage next to your bot, and select the channels you wish this bot to listen on, and who you wish to be able to message the bot
    • Consider setting strict user access, e.g. you only, so that you can restrict who can control the bot as the bot matures and gets more commands

About

Unofficial discord bot to view and control running freqtrade instances

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages