Skip to content

Fix redeem command parsing: handle /redeem and multiline keys correctly#28

Closed
PvlMamaev wants to merge 1 commit intodmcallejo:masterfrom
PvlMamaev:fix-redeem-command
Closed

Fix redeem command parsing: handle /redeem and multiline keys correctly#28
PvlMamaev wants to merge 1 commit intodmcallejo:masterfrom
PvlMamaev:fix-redeem-command

Conversation

@PvlMamaev
Copy link

This pull request fixes an issue where the /redeem command was not working properly due to incorrect key parsing and command matching logic.

Changes introduced:

  • Replaced basic regex parsing with _normalize_keys() to correctly extract CD-keys (5-5-5 format), even from multiline messages or with unusual formatting.
  • Added support for parsing redeem commands that use / instead of !, which previously caused crashes.
  • Replaced deprecated set(_REGEX_CDKEY.findall(...)) logic with more robust normalization that avoids assertion errors in ASFConnector.

Tested locally with both /redeem and !redeem commands — now works as expected.

Let me know if anything needs to be adjusted!

@dmcallejo
Copy link
Owner

Hello! Thank you for taking your time and submit a PR. I was not aware of these issues.
In fact I cannot replicate the !redeem /redeem command

@PvlMamaev
Copy link
Author

Hi! I’d like to withdraw this pull request for now.

After further testing, I realized that the original /redeem and !redeem commands do in fact work correctly under certain conditions. It seems the issue I was experiencing may have been related to my server environment, not the bot logic itself.

At this point, I cannot confidently say that the changes in this PR are necessary or beneficial. I will continue investigating the environment-specific issues on my side and might submit a more focused improvement in the future if needed.

Thanks again for your time and understanding!

@PvlMamaev PvlMamaev closed this Aug 1, 2025
@dmcallejo
Copy link
Owner

Thank you for your time anyway!

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