|
|
Why does this not work |
|
My script seems ok, I can do this in Python, it doesn't throw errors but the bot never responds to a question like What is CVE-2022-29315. I don't really know much about self and have been working from examples. Maybe it is the JSON parsing? I don't really know how that works in self. I put the script in the bot and moved it to the top of the list. I even tried it with just a return of "Duh" and it still didn't respond to the question (even without all the json stuff). So, maybe I just don't know how to get this in the bot's brain? Any examples would be helpful. Thanks state getCVE {
pattern "(what) (was is) [CVE CVE-ID ID] *?" template foo();
function foo() {
temp = http.requestJSON("https://cve.circl.lu/api/CVE-" + star );
//severityIs = temp.result.CVE_Items[0].impact.baseMetricV3.cvssV3.baseSeverity
descIs = temp.result.CVE_Items[0].cve.description.description_data[0].value
if (temp == null) {
return "I don't think so";
}
return (descIs);
}
}
|
|
|
|
|
|
|