Fork This Idea Slack Bot

Fork This Idea Slack Bot

17 devlogs
22h 48m
•  Ship certified
Created by Maadhav Bhatt

A Slack bot for submitting and voting on ideas.

Timeline

Ship 1

1 payout of shell 220.0 shells

Maadhav Bhatt

about 1 year ago

Maadhav Bhatt • Covers 17 devlogs and 22h 48m
Earned sticker

Restructure repo to move away from the single file approach towards a package with modules, and make relevant script changes.

chore: move app.py to src folder for new directory structure
chore: split app functionality from one file (app.py) to multiple files and create a package using init.py
fix: update start script to run app as a module instead of running it as a script

Update attachment
Earned sticker

A long debugging session. Probably longer than the tracked time.

The lesson is that I can't let in any curly braces or JSON-related symbols into my idea names, descriptions, etc. See this issue for more details.

In this session, I also tried simplifying the IDEA_DETAILS template, expanded the voting reaction emojis, and simplified the button link in fetched ideas.

fix: update count command to include 'me' as a valid option
feat: add additional emojis for upvotes
feat: use only the first word of the idea in the button link

Update attachment

style: restructure HELP_MESSAGE for clarity
feat: expand emoji sets for upvotes and downvotes to include additional options
refactor: control fetched ideas limit in _fetch params and change it from 10 to 5
feat: add optional environment variable and config handling for message submission channel messages

Update attachment

feat: update IDEA_DETAILS to use dictionary access for idea attributes and improve message formatting

refactor: make _fetch function more readable

fix: include timestamp and votes in idea data retrieval from Firebase

~2h of untracked debugging

Update attachment

fix: update emoji sets to use strings and adjust vote handling logic for reactions

A lot of debugging.

Update attachment

feat: enhance vote management by allowing separate upvotes and downvotes, and validate input for vote updates

Fix Slack API settings for new functionality.

Update attachment

feat: add IDEA_DETAILS lambda for structured idea presentation with submission info and web link

feat: implement vote updating functionality and handle reactions for ideas

fix: add missing 'me' subcommand to COMMANDS global variable, split votes into upvotes and downvotes in idea dicts, convert blocks dict to array of dicts, use blocks kwarg instead of message in handlecommand function
refactor: handlecommand function, move app initialization to the end, replace decorators with methods

refactor: write help and invalid command messages as blocks instead of strings, and write relevant changes in the implementation

docs: add docstrings to sendephemeralmessage and sendchannelmessage functions for clarity

feat: allow blocks and refactor message handling functions to improve clarity and reusability

Update attachment

feat: improve idea fetching and counting

Update attachment

docs: add type hints and docstrings to Firebase interaction functions for improved clarity and documentation

WIP: Work on subcommands

Update attachment

feat: enhance idea fetching functionality to allow for subcommands and improve command parsing

refactor: replace 'command' with 'message' in 'PI:' message handling

refactor: command handling to improve clarity and structure

feat: add and move command and subcommand validation

Update attachment

feat: simplify start.sh by removing environment variable setup and relevant directory changes and log python errors (undoes some older changes)

chore: remove setenvvars.sh from .gitignore

and other maintainance and debugging. The attached image is not particularly informative, but I deleted the terminal so I don't have access to the changes I made on Nest.

Update attachment

Debug. The bot service (systemd) wasn't running properly.

feat: remove .env.example and update start.sh to ensure environment variables are set correctly

Update attachment

feat: update README with Firebase and Nest setup instructions and correct project link
feat: add example service and env files
feat: ensure start.sh is executable after cloning the repository and create and ignore script to set environment variables

Update attachment

feat: add timestamp to idea submission details and update handling functions
fix: send bot messages in thread
feat: add update script for cloning and updating the repository when hosting
feat: enhance idea submission by adding user name and vote tracking and update subcommands
fix: remove debugging print statements

Update attachment

feat: separate slash commands and message prefixes, implement slash command and subcommand handling for idea fetching, counting, and help responses, add lambda functions for streamlined messages

refactor: simplify redundant return statement in getideacountfromfirebase()

Update attachment

WIP: Separate slash commands and message prefix to create subcommands and flags

Commits
refactor: extract command parsing logic into a separate function for better readability
feat: enhance idea submission handling with dedicated message templates and functions
feat: create message threads instead of sending new ones

Update attachment

feat: refactor handle_command to handle both slash commands and 'PI' prefixed messages

Update attachment