Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Historical Messages #794

Closed
nthnyvllflrs opened this issue Jan 14, 2025 · 1 comment
Closed

Historical Messages #794

nthnyvllflrs opened this issue Jan 14, 2025 · 1 comment

Comments

@nthnyvllflrs
Copy link

Hi there everyone, I was looking for resources on how I can populate historical messages, I tried manually setting the timestamp of the message in the payload, but it didn't work.

I currently have a working application service bridge, which receives and sends out messages. Any suggestions on how I can do historical messages, or any resource will help, thank you.

@nthnyvllflrs
Copy link
Author

nthnyvllflrs commented Jan 15, 2025

If anyone might have the same problem, this is how I solved it, thru application service bridge.

# matrix url
url = f"https://{HOMESERVER}/_matrix/client/v3/rooms/{room_id}/send/m.room.message?ts={timestamp}" 

# request payload
payload = {
    "msgtype": "m.text",
    "body": f"{message} - {convert_date}", 
} 

# submit request
response = requests.post(url, headers=REQUEST_HEADERS, json=payload) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant