FPLOpticord is a small wrapper over the FPL Optimization Tools python solver for Discord, which runs on Zig.
FPLOpticord is in quite early stages of development, issues may arise. If you run into one, please check out the known issues section and, if it is not there, please report the issue on the issues page!
As of right now, there are no precompiled binaries, but precompiled binaries are planned to be supported.
- Prerequisites
- Install Zig 0.14.0
- Copy .env.example and replace the placeholder variables with valid data.
- Run
zig build run
token=<ADD DISCORD TOKEN HERE>
prefix=<ADD YOUR BOT PREFIX HERE>
optimization-tools-path=<ADD YOUR PATH TO THE SOLVER HERE>
IMPORTANT: Do NOT give your Discord token to anyone who you do not trust, as you will be giving them full access to the bot account until the token is reset. This can have major consequences and, depending on the permissions the bot has been given, it can lead to the server getting nuked.
-
token
- Your Discord bot token. It is located inside the
Botsection undertoken. IMPORTANT: Do not share this with others!
- Your Discord bot token. It is located inside the
-
prefix
- The prefix that will be added to the commands, in order to distinguish itself from other bots. (ex.
!)
- The prefix that will be added to the commands, in order to distinguish itself from other bots. (ex.
-
optimization-tools-path
- The path to /run folder of the solver. If you are running this on WSL, provide the Windows path to the solver instead of the WSL one (ex. use
D:/FPL-Optimization-Toolsinstead of/mnt/d/FPL-Optimization-Tools).
- The path to /run folder of the solver. If you are running this on WSL, provide the Windows path to the solver instead of the WSL one (ex. use
-
Unstable performance on Windows
Due to an issue in Zig's standard library, websockets on Windows tend to randomly close. The Zig std pull request currently addressing the issue is here, tracked on the wrangle-writer-buffering branch of Zig.
ETA for the fix would be at some point during Zig's
0.15.0-devcycle, however a specific timeline is hard for me to provide as I don't work on Zig or websocket.zig 😅.Workaround: Run the bot on Linux or WSL until the pull request is merged in Zig.