Ooglely / pugBot

Discord bot to run TF2 pick up games | pugbot.tf
https://pugbot.tf
21 stars 1 forks source link

Log tracker and implementation #18

Closed Ooglely closed 8 months ago

Ooglely commented 10 months ago

Logs (and part of the logs.tf API) is already in the bot, however a way to track every log that is played from a server that the bot has hosted is needed for ELO and other features in the future.

In addition to just tracking logs, adding the ability to set a channel for the bot to post logs automatically is a good idea.

The way I am currently thinking of setting this up:

  1. On a team generation/team move (to support captained pugs), created a PartialLog object, that contains all players in the match represented as a Player object (which stores the discord ID and/or steam ID of each player), the guild ID, the PugCategory the match is being played in, and a timestamp.
  2. These PartialLog object will be added to a queue, where a function will check for logs that match the steam ID's of the players in the PartialLog object. If a matching log is found, a Log object is created using the log data and all of the data stored in the PartialLog
  3. The log will then be passed to functions that add it to the database, post it where it needs to go, passes it to ELO calculation (#16) etc.