Enable sending IRC messages from context modal

This commit is contained in:
2022-08-03 07:20:30 +01:00
parent c012792c42
commit c9a17a6fa4
8 changed files with 84 additions and 26 deletions

View File

@@ -42,4 +42,5 @@ def construct_query(index, net, channel, src, num, size):
"fields": fields,
"_source": False,
}
print("QUERY", query)
return query

View File

@@ -193,3 +193,11 @@ def get_irc_alerts(user):
element["time"] = time
results_parsed.append(element)
return results_parsed
def send_irc_message(net, num, channel, msg):
channel = urllib.parse.quote(channel, safe="")
url = f"irc/msg/{net}/{num}/{channel}"
payload = {"msg": msg}
messaged = threshold_request(url, payload, method="PUT")
return messaged