Pbatch / ClashRoyaleBuildABot

A platform for creating bots to play Clash Royale
MIT License
216 stars 37 forks source link

Messages Integration with Enhanced Logging #187

Closed FikryCoder closed 4 months ago

FikryCoder commented 4 months ago

This pull request will help improve the manageability of our code by consolidating all console messages into one file named `messages.py’. Some of the changes made are:

Identification and Extraction:

Went through every script to identify and extract every message printed on the screen.

Creation of Messages.py:

Created another file called `messages.py’

Have constants for each message that was extracted in order to centralize all console messages in one place.

Updating Scripts:

Updated any relevant scripts to import needed constants from `messages.py’ Replaced some hard-coded messages in the scripts with references to these constants.

By doing this refactoring, we ensure that all console messages come from one place which makes it easier to update and maintain them. Any future changes that will be done concerning any of these messages will only need to be made at one location hence reducing inconsistencies risk, hence making code easy to read.

Kindly review these changes giving your feedbacks. Thank you ❤️

Pbatch commented 4 months ago

We're swapping to a single bot class now, so don't need constants to store messages! :)

@all-contributors add @FikryCoder for research

allcontributors[bot] commented 4 months ago

@Pbatch

I've put up a pull request to add @FikryCoder! :tada: