Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved structure and readability of main.py #196

Merged
merged 3 commits into from
Jun 28, 2023

Commits on Jun 25, 2023

  1. improved structure and readability of main.py

    1.Removed unnecessary import statements (import sys, import shutil, import getpass).
    
    2.Encapsulated the code inside the BotCore class to provide better organization and encapsulation.
    
    3.Replaced hardcoded configuration values with variables (self.server_url, self.port, self.name, etc.).
    
    4.Utilized the os.path module for path-related operations instead of manually concatenating strings.
    
    5.Updated the logging statements to use the logger instance.
    
    6.Refactored the message_info method to handle exceptions and return a dictionary with all fields set to prevent None values.
    
    7.Updated the methods method to return a dictionary of method references.
    
    8.Added docstrings to functions and methods.
    
    9.Fixed the indentation of the code to conform to Python style guidelines.
    
    10.Replaced the print statements with logger statements for consistent logging.
    
    11.Modified the load_plugins_from_folder method to handle different sources of plugin names (from configuration file or directory) and log errors appropriately.
    
    12.Updated the load_plugins method to load plugins from the specified folders.
    
    13.Refactored the run_plugins method to use the loaded plugins and pass the necessary arguments to the plugin's run method.
    
    14.Renamed command_parser method to core_commands_parse for clarity.
    
    15.Removed unused methods and variables (self.sp_command, self.core_plugins, pull).
    
    16.Added missing exception handling in the quit method.
    
    17.Cleaned up the code formatting and removed unnecessary comments.
    AnastasiosZyngiridis authored Jun 25, 2023
    Configuration menu
    Copy the full SHA
    e1c2eac View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2023

  1. Configuration menu
    Copy the full SHA
    e3c731b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    096bce9 View commit details
    Browse the repository at this point in the history