79459982

Date: 2025-02-22 17:14:46
Score: 0.5
Natty:
Report link

If all you need is input/output/exception/calls of your function chain, try pip install detective-snapshot.

Add @snapshot() decorator to the functions you want to track, and it will log structured JSON files like this for each run of flip_coin (or whichever is your entrypoint function)

{
  "FUNCTION": "flip_coin",
  "INPUTS": {
    "ctx": {
      "message": {
        "author": "CoolUser#1234"
      }
    }
  },
  "OUTPUT": "Tails",
  "CALLS": [
    {
      "FUNCTION": "random.randint",
      "INPUTS": {
        "a": 1,
        "b": 2
      },
      "OUTPUT": 2
    },
    {
      "FUNCTION": "currentTime",
      "INPUTS": {},
      "OUTPUT": "2024-02-22 15:30:45"
    },
    {
      "FUNCTION": "bot.say",
      "INPUTS": {
        "message": "Tails"
      },
      "OUTPUT": null
    }
  ]
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user21748703