johndutchover / short-circuit-me

Slack App using Bolt for Python
https://gitlab.com/johndutchover/short-circuit-me
0 stars 0 forks source link

important message known contacts dict #8

Closed johndutchover closed 1 year ago

johndutchover commented 1 year ago

https://github.com/users/pybites/projects/13/views/2?pane=issue&itemId=30301933

johndutchover commented 1 year ago

@Zaubeerer Please revisit the issue in project and advise appropriate status and schedule. It was part of the related issue but split off to this issue.

Zaubeerer commented 1 year ago

Yeah, I think high-level the next question is what you want to focus on for the MVP.

I suggest:

For the latter, this dictionary of known contacts may be a good option, right?

johndutchover commented 1 year ago

Deployment to Fly sounds good, using Docker if that's fine with you - it's actually the reason I am using same code, python version and poetry environment for containers.

johndutchover commented 1 year ago

MongoDB collection from what I recall can easily be used in lieu of dictionary. It may keep code consistent and only need a second collection- call it something like contactscollection.

johndutchover commented 1 year ago

Example from ChatGPT

from fastapi import FastAPI
from pydantic import BaseModel
from pymongo import MongoClient

# Define the data model
class Item(BaseModel):
    date: str
    count1: int
    flag: int
    count2: int

# Create a FastAPI instance
app = FastAPI()

# Connect to MongoDB
client = MongoClient("mongodb://localhost:27017/")
db = client["mydatabase"]
collection = db["mycollection"]

# Define a POST method for creating a MongoDB document
@app.post("/items/")
async def create_item(item: Item):
    # Convert the item to a dict so it can be stored in MongoDB
    item_dict = item.dict()
    result = collection.insert_one(item_dict)
    return {"inserted_id": str(result.inserted_id)}
Zaubeerer commented 1 year ago

Hey @johndutchover, I suggest to keep this one open, since a dictionary with important and other contacts is not yet implemented, is it?

johndutchover commented 1 year ago

Hey @johndutchover, I suggest to keep this one open, since a dictionary with important and other contacts is not yet implemented, is it?

No, not yet. I will work on the dictionary now that deployment to fly (single container) is done @Zaubeerer .

johndutchover commented 1 year ago

@Zaubeerer I got into a bit of a ChatGPT circle, but regained focus and able to find user_id in Slack. Not part of dataframe. However added simple password to streamlit scm123mvp. Behavior is a bit out of sorts:

Upon visiting https://scm-frontend-1831.fly.dev

Screenshot 2023-06-16 at 6 26 41 PM

After successful login:

Screenshot 2023-06-16 at 6 27 00 PM
johndutchover commented 1 year ago

reverted password auth because it's not worth the time and effort

johndutchover commented 1 year ago

It is so important to clearly describe these issues. Unclear GitHub issues result in confusion. This issue is for "important message known contacts" dict. For the future, working with CSV files is a pain.

johndutchover commented 1 year ago

bolt has a learning curve, and maybe knowing what to look for such as this? https://slack.dev/bolt-python/concepts#context

johndutchover commented 1 year ago

This is more complex on the Slack Bolt side and I am using ChatGPT instead of coding myself, which is not ideal.

johndutchover commented 1 year ago

It's also good to define words such as "methods" especially when issue is related to python. See [here](https://slack.dev/bolt-python/concepts#:~:text=use%20the%20message()-,method,-which%20filters%20out) for an example.

johndutchover commented 1 year ago

Coach @Zaubeerer I had to mark this as blocked.

johndutchover commented 1 year ago

lost in the weeds with "known contacts dict"

johndutchover commented 1 year ago

The best I can do, of course with ChatGPT help mostly, is to add by Slack UID:

Screenshot 2023-06-19 at 4 56 22 PM
johndutchover commented 1 year ago

I am marking this done @Zaubeerer @bbelderbos because too much time is being spent and not enough learning in my opinion

johndutchover commented 1 year ago

The dashboard is looking good EXCEPT that

Screenshot 2023-06-19 at 5 24 53 PM
Zaubeerer commented 1 year ago

Hey @johndutchover, I suggest to keep this open, as it is not done, but we can move on to other tasks, for sure!

I would slightly disagree and say that it would be super cool to have a dashboard categorizing messages as your app provides!

However, you can ask yourself, what is missing in the app to make it even more valuable and then create issues to implement those features :)