Skip to content

Conversation

ihasTaco
Copy link
Owner

@ihasTaco ihasTaco commented Aug 4, 2023

This pull request introduces numerous features and bug fixes, including optimizations to improve the bot's reliability when querying multiple servers. Additionally, we've made coding style enhancements and important updates to the Backend API.

List of Changes

  • Optimizations: Enhanced the bot to reliably query multiple servers simultaneously, using the servers' refresh_interval to keep queries on time and regularly updated.
  • Code Style: Integrated ESLint to ensure consistent coding styles across the codebase.
  • Backend API Updates: Simplified the writing of queryState by introducing a new API that only writes the messageID, eliminating redundancy.
  • Variable Naming: Shifted from snake_case to camelCase for variable names and made other variable naming improvements.
  • Guild Threshold Feature: Added a feature to check if the bot is in a set amount of guilds (default: 2500) and restart the bot, using sharding after reaching the threshold. Note: This feature is still under development and hasn't been thoroughly tested. Use with caution!

Added a temporary notice
I believe I have fixed a couple of issues:

* Possible Fix for [issue #9](#9)

* Possible Fix for [issue #1](#1)

Added a new feature

* Added a logging system
I've added a fix for the graph height issue for issue #12

Changed how Trend data is calculated, the trend data will now include the first days worth of data
I am working on optimizing the bot so that it will run smoother and faster

I've also changed a bunch of variable names, and set up ESLint to help with consistency and find errors quicker

Please note, this will only process the servers.json file once and will just halt, as I havent set up the loop yet!
Ive added looping functionality to the bot, also I've fixed an issue where the guild wasnt being initialized if the bot was added when the bot was running
});
});

fs.readFile('./public/server_info.json', 'utf8', (err, data) => {
if (err) throw err;

Check failure

Code scanning / CodeQL

Server crash

The server of [this route handler](1) will terminate when an uncaught exception from this location escapes an [asynchronous callback](2).
serverInfo[guild_id] = {};
}
if (!serverInfo[guild_id][server_uuid]) {
serverInfo[guild_id][server_uuid] = {

Check warning

Code scanning / CodeQL

Prototype-polluting assignment

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [user controlled input](1).
if (!(server_uuid in jsonData[guild_id])) {
jsonData[guild_id][server_uuid] = {
if (!(serverUUID in jsonData[guildID])) {
jsonData[guildID][serverUUID] = {

Check warning

Code scanning / CodeQL

Prototype-polluting assignment

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [user controlled input](1).
jsonData[guild_id][server_uuid].status = server_info.status;
jsonData[guild_id][server_uuid].last_restart = server_info.last_restart;
jsonData[guild_id][server_uuid].message_id = server_info.message_id;
jsonData[guildID][serverUUID].map = queryState.map;

Check warning

Code scanning / CodeQL

Prototype-polluting assignment

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [user controlled input](1).
jsonData[guildID][serverUUID].map = queryState.map;
jsonData[guildID][serverUUID].players.push(queryState.active_players);
jsonData[guildID][serverUUID].ping.push(queryState.ping);
jsonData[guildID][serverUUID].status = queryState.status;

Check warning

Code scanning / CodeQL

Prototype-polluting assignment

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [user controlled input](1).
jsonData[guildID][serverUUID].players.push(queryState.active_players);
jsonData[guildID][serverUUID].ping.push(queryState.ping);
jsonData[guildID][serverUUID].status = queryState.status;
jsonData[guildID][serverUUID].last_restart = queryState.last_restart;

Check warning

Code scanning / CodeQL

Prototype-polluting assignment

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [user controlled input](1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bot Fails to Update Guild List When a New Guild is Added Bot Occasionally Fails to Update Embeds
1 participant