Building a Solid Architecture & Custom Logger for VOIDBOT
Today I spent a solid hour setting up the foundations for VOIDBOT. Since I have no prior experience building Slack bots, I wanted to make sure the project structure was robust right from the start instead of just packing everything into a single file.
Here is what I achieved during this coding session:
- Setup and modularity: Created a dedicated
config.pyfile to handle environment variables automatically. If the.envfile is missing, the script generates a template setup by itself to prevent crashes. - Main Engine: Configured
main.pyusing the Slack Bolt framework in Python. Tied it directly with the configuration module to keep the tokens clean and secure. - Custom Utility: Coded a custom logging module (
logger.py) from scratch. It captures accurate timestamps using Python’s datetime library and appends command usage and user IDs into a localactivity.logfile whenever a command is triggered. - Core Requirements: Fully structured the 3 mandatory slash commands (/ping, /about, and /voidtune) with strict adherence to Slack’s 3-second acknowledgement rule.
Everything is pushed to my GitHub repository, and my Hackatime is running smoothly. Ready to tackle the Slack API portal and credentials next!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.