Skip to content

Conversation

@LeonTheDev-io
Copy link
Contributor

@LeonTheDev-io LeonTheDev-io commented Jul 4, 2025

Adds average ticket rating statistic

This PR introduces a new feature that calculates and displays the average rating for closed tickets. The average rating is available in relevant API responses and placeholders (Opening Message, Bot Activity) ({avgRating}).

image

Versioning information

  • This includes major changes (breaking changes)
  • This includes minor changes (minimal usage changes, minor new features)
  • This includes patches (bug fixes)
  • This does not change functionality at all (code refactoring, comments)

Is this related to an issue?

None found

Changes made

  • Added support for calculating and displaying the average ticket rating (avgRating) across the bot:
    • Implemented getAverageRating in the stats worker and exposed it via the stats pool.
    • Updated ticket manager, client ready listener, and API routes to fetch and include average rating in stats.
    • Updated stat placeholders in messages and activity strings to support {avgRating}.
    • Ensured average rating is formatted to one decimal place where displayed.

Confirmations

@RooRay
Copy link
Contributor

RooRay commented Jul 4, 2025

looks good! i'll test this on my own instance now and check all is good.

in the meantime, the docs need to be updated with the new placeholders and other details. do you think you could do this?

@RooRay RooRay self-requested a review July 4, 2025 22:22
@LeonTheDev-io
Copy link
Contributor Author

PR for the docs is linked above
Tell me if I missed something

@RooRay
Copy link
Contributor

RooRay commented Jul 4, 2025

PR for the docs is linked above Tell me if I missed something

whoops sorry I just realised that 😂

Copy link
Contributor

@RooRay RooRay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good! testing confirms no issues

@RooRay
Copy link
Contributor

RooRay commented Jul 4, 2025

there we go, after I totally didn't nuke my test bots .env file I managed to test everything and all looks great! thank you for your contributions!

@RooRay RooRay merged commit c780544 into discord-tickets:main Jul 4, 2025
8 checks passed
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.

2 participants