Roses are red, slack is sluggish, but HackCLI will make you forget about that rubbish.
Hack Club's slack on steroids, but in your terminal and FASTER. Checking a channel or adding a devlog without leaving the IDE is GOATED.
No followers yet
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
This is starting to look like something, no hope is lost.
You can focus different components with tab or shift+tab. When writing the command you specify a channel which will be opened on app start. When that happens, or you choose a different channel in the sidebar, the chat history for this newly opened channel loads, after that it's up to this LAZY ASS websocket SLOP to deliver live messages when they are sent in the original slack channel. I had a lot of issues with websocket (as you can probably tell), it was giving me messages in random order, from before the app even started and all sorts of stuff. I don't think everything is sorted out in that regard, so I will have to take a closer look at it.
Next to implement would be the input, bc it currently does nothing, but that will be quick. Also I am working on a userCache, currently after a message is rendered the user's ID is displayed instead of their display name for like ~200ms, then it's rerendered with the proper display name, but next time this user writes a message it will instantly have the user's display name text to it, thanks to the caching. Maybe I will also add all the users to the cache in the background while the app is running, unless that's not too overkill.
Sad to end on a sad note, but unfortunately my app is inherently limited by the slack rate limits (😠😤) aside from the slack api limitations in general. I am not sure how far I can take this app, if it's going to be usable by more people simultaneously than just me (if anyone would ever even want to use it). Either way, I WILL make it right. Maybe I will have to use some tricky, sussy, hacky ways, maybe drop some people d*ad (can I say that here? let me know in the comment or smth, don't want to get my project banned or smth) in the process, but I will get where I need to get, understood? Aight, see ya tomorrow
ROGER THAT
Aight so I have been working on the main command: hackcli channel open. Probably gonna change this command name or the structure of the commands entirely again because it sounds clunky. A LOT HAS HAPPENED.
So basically with this command a TUI opens where you can interact with your slack channels just like in slack (sidebar, chat with messages and input to type a message). First I split up this program into four smaller ones, but then I decided to have just one big program as everything was easier that way. I learned a lot about websocket and that kinda stuff because I use that to get notified from the slack api when a message is posted to a channel for example so I can display it live in the TUI. I also used go routines and channels for the first time, not complex scenario but still learnt from it. Currently the messages don't appear in the chat for some reason, will have to check why that is and fix. The UI looks like shiet, but I am working on it, will look good in no time, trust me.
I HAVE BEEN TRYING TO UPDATE A CUSTOM PROFILE FIELD FOR 5 HOURS...
SPOILER I FAILED **END OF SPOILER (if you know how to do that you can comment)
Yeah clicking enter now actually updates your slack profile and shows a confirmation message, but I had to remove the Fav Activities field. The slack go sdk failed me and I had to make some http requests manually to the slack go sdk. Tried literally everything possible at this point to update the custom field, but idk it's impossible, everything was correct, change my mind. It's crazy how many weird debugging methods I am using XD, I won't ever learn the correct way to debug code LOL.
I'm writing this in the middle of the night. Added an edit command and a first argument being profile (hackcli edit profile). Basically you can edit some of the more important profile information of yours through a nice UI. I got to know Bubble tea from it's evil side and am pretty discouraged. There is a high chance I am overcomplicating everything or doing it the completely wrong way, idk but the way bubble tea does it's stuff seems really wrong coming from javascript and react. Either way... this command is not yet finished, I have to figure out how to update the user's profile info, because for some reason there is no simple method for that in the go slack sdk.
Quick update INCOMING!
The login command now checks if the user already has a valid slack token in the config.json file (if the user is logged in). If user is logged in the cli prompts him that he can use all features of HackCLI now and if user is not logged in they will complete the login flow
At first I was so overwhelmed with cobra and bubble tea that it was crazy, but after some time it wasn't that bad. I decided to have a different command for a different feature. Now I can think of it as creating many smaller apps, instead of a big one, this makes things easier. SOOO chat, I created the first command - LOGIN, basically the user authorizes the HackCLI slack app that I created, gets the token from a backend function, pastes it into the cli and then we create a config file on the user's machine with the token and all other commands will be able to use this token to do stuff on the user's behalf (the user will be logged in). So yeah, will only get easier from now on, right? RIGHT?!
OH, btw I have not tested this command at all LOL, so it is bound not to work, as per usual, because never works on the first try for me, but little debugging will do the trick.