import treq
This commit is contained in:
parent
ab6c8b78d7
commit
26d88fa7d8
1 changed files with 2 additions and 2 deletions
|
@ -2,6 +2,7 @@ import requests
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
import treq
|
||||||
from twisted.internet.defer import inlineCallbacks, returnValue
|
from twisted.internet.defer import inlineCallbacks, returnValue
|
||||||
from synapse.module_api import ModuleApi, errors
|
from synapse.module_api import ModuleApi, errors
|
||||||
from synapse.types import UserID
|
from synapse.types import UserID
|
||||||
|
@ -200,9 +201,8 @@ class InviteChecker:
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Send the message directly
|
|
||||||
send_response = yield treq.put(send_url, headers=headers, json=content)
|
send_response = yield treq.put(send_url, headers=headers, json=content)
|
||||||
response_body = yield send_response.text() # Capture the response text for logging
|
response_body = yield send_response.text()
|
||||||
if send_response.code == 200:
|
if send_response.code == 200:
|
||||||
logger.info(f"Message sent to room {self.config.announcement_room_id}: {message_content}")
|
logger.info(f"Message sent to room {self.config.announcement_room_id}: {message_content}")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue