I don't know how to format the messages and I keep getting this error
Here is my code for the sending script:
asyncdefsend_message(auth_mgr, recipient_xuid, message_text, client_session):
xbl_client=XboxLiveClient(auth_mgr=auth_mgr)
try:
formatted_xuid=recipient_xuidprint(formatted_xuid)
awaitxbl_client.message.send_message(
xuid=recipient_xuid,
message_text=message_text
)
print(f"Message sent to XUID {recipient_xuid}: {message_text}")
exceptExceptionase:
traceback.print_exc()
print(f"Failed to send message: {e}")But keep on getting this annoying error
Traceback (mostrecentcalllast):
File"/Users/*****/Desktop/Python projects/*****/xbox_messaging_debug.py", line50, insend_messageawaitxbl_client.message.send_message(
File"/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/xbox/webapi/api/provider/message/__init__.py", line133, insend_messageresp.raise_for_status()
File"/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/httpx/_models.py", line761, inraise_for_statusraiseHTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Clienterror'400 Bad Request'forurl'https://xblmessaging.xboxlive.com/network/Xbox/users/me/conversations/users/xuid(*****)'Formoreinformationcheck: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400Failedtosendmessage: Clienterror'400 Bad Request'forurl'https://xblmessaging.xboxlive.com/network/Xbox/users/me/conversations/users/xuid(*****)'Formoreinformationcheck: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
I dont know if there is a format for the xuid that I need or something else...
I don't know how to format the messages and I keep getting this error
Here is my code for the sending script:
But keep on getting this annoying error
I dont know if there is a format for the xuid that I need or something else...