OhhLoz / HLTVBot

A stats based bot using HLTV to display statistics & news for the CS:GO competitive scene.
https://www.laurenceure.me
GNU General Public License v3.0
3 stars 1 forks source link

Increase code reusability, particularly with regards to the page functions. Perhaps even moving those functions to another file to help with readability. #22

Open OhhLoz opened 4 years ago

OhhLoz commented 4 years ago

Also a refactor of the code base to make finding specific commands may be helpful.

OhhLoz commented 4 years ago

JavaScript doesnt allow functions inside different files AFAIK. implementation of issue #27 should help with main bot.js readability. Perhaps making 1 function handle all of the page functionality would be best. Currently I have 1 that performs 3 page tasks and 2 that handle 1 page task each.

OhhLoz commented 2 years ago

Whilst the latter is implemented in 1.6.4, there is still some code reuse in the page functions as they behave similarly with slight differences. The matches function attempts to reduce this using COMMANDCODES to check for livematches, matches or results commands, however the other page functions do not