Use JSON for sending messages
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import urllib.parse
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from core.lib.opensearch import client, run_main_query
|
||||
@@ -194,9 +192,8 @@ def get_irc_alerts(user):
|
||||
|
||||
|
||||
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}
|
||||
url = f"irc/msg/{net}/{num}"
|
||||
payload = {"msg": msg, "channel": channel}
|
||||
if nick:
|
||||
payload["nick"] = nick
|
||||
messaged = threshold_request(url, payload, method="PUT")
|
||||
|
||||
Reference in New Issue
Block a user