Properly implement queries

This commit is contained in:
2022-08-03 07:20:30 +01:00
parent 1d2f37f588
commit 6af8e94336
7 changed files with 31 additions and 9 deletions

View File

@@ -195,9 +195,11 @@ def get_irc_alerts(user):
return results_parsed
def send_irc_message(net, num, channel, msg):
def send_irc_message(net, num, channel, msg, nick=None):
channel = urllib.parse.quote(channel, safe="")
url = f"irc/msg/{net}/{num}/{channel}"
payload = {"msg": msg}
if nick:
payload["nick"] = nick
messaged = threshold_request(url, payload, method="PUT")
return messaged