Msfish is a statistics bot for the War Fish War Brokers squad. This bot collects stats from stats.warbrokers.io periodically based on when a player last played. The charts show the time series, wheras the discord bot can be queried for medals and some activity stats. Msfish was created to answer the question of who is active and who is winning medals on Warbrokers.
> 'select * from playerstatus' | sqlite3 public/msfish.db -markdown
ℹ️ Debuging node with Chrome DevTools requires running node with --inspect and then opening chrome://inspect to attach to the node process
- get medal details from the hover pop up
-
A javascript runtime on my server at home. It runs a discord bot that interacts with users, but also fetches the data from stats.warbrokers.io and sends the data to a public repository
-
Discord bot based on the tutorial almost straight copy. the config.mjs file is .gitignored so, the secret keys are not in the repo see config.example.mjs
-
A DOM document is a tree representation of a web page in memory made of nodes. Loading a page into JSDOM allows searching using XPath. XPath is a path into a dom just like a directory path that leads to a location on your web server.
-
The database and the devel repo are always together, meaning updates to the database are pushed to github 🪐 We use Github Desktop, because multiple editors (micro,builder,vscode) node-shedule job, gitpushdb, relies on github ssh keys without passwords.
-
We have some overlap in functionality with various methods of accessing sqlite3, because I started with bare-bones, realized needed to promisify it, and finally realized I also need an in-browser library for client-side.
-
https://sqlite.org/wasm/doc/trunk/index.md for reference. This project started using sql.js on the index.html (charts page), but has since switched to the wasm library from sqlite.org
-
Highcharts are heavily dependent on Moment.js.
-
A live server like npx http-server is only needed for testing
-
css layout and styles. the swatchpicker project is .gitincluded and github actions adjusted .github/workflows/static.yml
-
used to create systemd service and very useful monitoring tool
# file: /etc/systemd/logind.conf
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target