Skip to content

Refactor Karma and Thanks to simplify and avoid exploits#325

Merged
Pierre-Demessence merged 21 commits into
Unity-Developer-Community:masterfrom
hariedo:master
Jun 13, 2025
Merged

Refactor Karma and Thanks to simplify and avoid exploits#325
Pierre-Demessence merged 21 commits into
Unity-Developer-Community:masterfrom
hariedo:master

Conversation

@hariedo

@hariedo hariedo commented Jun 13, 2025

Copy link
Copy Markdown

Found a couple small exploits/edgecases and overly complex code in the Thanks patterns and Karma credit code. Also using some of the previously added phrase-list grammar extensions.

hariedo added 3 commits June 12, 2025 12:45
Formats message differently, avoids a karma farming exploit.  May refactor again to just use the string extension ToCommaList, and simplify the disallowed mentions logic.
@github-actions

Copy link
Copy Markdown

🚀 Deploy this PR to an environment

You can deploy this PR to either development or staging environment:

  • Comment /deploy_dev to deploy to the development environment

Alternatively, you can:

  1. Go to Actions tab
  2. Click on "Manual Deploy to Firebase" workflow
  3. Click the "Run workflow" button
  4. Select branch: master
  5. Choose environment: DEV
  6. Enter a deployment message
  7. Click "Run workflow"

@deepsource-io

deepsource-io Bot commented Jun 13, 2025

Copy link
Copy Markdown

Here's the code health analysis summary for commits 22a0d71..800ba11. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource C# LogoC#✅ Success
🎯 5 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@hariedo

hariedo commented Jun 13, 2025

Copy link
Copy Markdown
Author

/deploy_dev

@github-actions

Copy link
Copy Markdown

🚀 Starting deployment of hariedo/UDC-Bot:master to development...

@hariedo

hariedo commented Jun 13, 2025

Copy link
Copy Markdown
Author

/deploy_dev

@github-actions

Copy link
Copy Markdown

🚀 Starting deployment of hariedo/UDC-Bot:master to development...

@hariedo

hariedo commented Jun 13, 2025

Copy link
Copy Markdown
Author

/deploy_dev

@github-actions

Copy link
Copy Markdown

🚀 Starting deployment of hariedo/UDC-Bot:master to development...

@hariedo

hariedo commented Jun 13, 2025

Copy link
Copy Markdown
Author

/deploy_dev

@github-actions

Copy link
Copy Markdown

🚀 Starting deployment of hariedo/UDC-Bot:master to development...

@hariedo hariedo marked this pull request as ready for review June 13, 2025 02:59
@hariedo

hariedo commented Jun 13, 2025

Copy link
Copy Markdown
Author

/deploy_dev

@github-actions

Copy link
Copy Markdown

🚀 Starting deployment of hariedo/UDC-Bot:master to development...

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Refactors Karma and Thanks logic to simplify error handling, prevent edge-case exploits, and streamline message formatting using new string extensions.

  • Removed unused exception variable declarations in WebUtil
  • Enhanced the thanks regex to skip “no thanks” phrases and filter out bots/self mentions
  • Introduced ToBold extensions and ensured awaited deletions in moderation commands

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
DiscordBot/Utils/WebUtil.cs Swallowed exceptions by dropping variable names in catch blocks
DiscordBot/Settings/Deserialized/Settings.cs Added TipsUserRoleId and TipsAuthorRoleId settings
DiscordBot/Services/UserService.cs Updated thanks regex, filtered mentions, refactored DB updates
DiscordBot/Modules/ModerationModule.cs Added await to asynchronous delete calls
DiscordBot/Extensions/StringExtensions.cs Added ToBold and ToBoldArray extension methods

Comment thread DiscordBot/Utils/WebUtil.cs
Comment thread DiscordBot/Services/UserService.cs
Comment thread DiscordBot/Services/UserService.cs
@hariedo

hariedo commented Jun 13, 2025

Copy link
Copy Markdown
Author

/deploy_dev

@github-actions

Copy link
Copy Markdown

🚀 Starting deployment of hariedo/UDC-Bot:master to development...

@Pierre-Demessence Pierre-Demessence merged commit 5e124ce into Unity-Developer-Community:master Jun 13, 2025
5 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.

3 participants