Skip to content
New issue

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

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

Already on GitHub? # to your account

Trouble accessing attachment #92

Closed
kevincw01 opened this issue Feb 6, 2025 · 3 comments
Closed

Trouble accessing attachment #92

kevincw01 opened this issue Feb 6, 2025 · 3 comments

Comments

@kevincw01
Copy link

kevincw01 commented Feb 6, 2025

I'm struggling to access an image attachment. Theres nothing in the example so I reviewed the message unit test and I see they are accessing context.message.attachments_local_filenames[0]. But when I try to access it I get an error that it doesn't exist. Any tips?

INFO:root:[Raw Message] {"envelope":{"source":"+<snip>","sourceNumber":"<snip>","sourceUuid":"<snip>","sourceName":"Kevin","sourceDevice":1,"timestamp":1738827889547,"serverReceivedTimestamp":1738827899253,"serverDeliveredTimestamp":1738827899254,"dataMessage":{"timestamp":1738827889547,"message":"Stop","expiresInSeconds":0,"viewOnce":false,"attachments":[{"contentType":"image/jpeg","filename":null,"id":"n_mhLABBAI_ol9OG_ab6.jpg","size":94059,"width":1024,"height":1051,"caption":null,"uploadTimestamp":1738827891130}]}},"account":"<snip>"} botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00071 seconds botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00091 seconds botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00135 seconds botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00168 seconds botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00202 seconds botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00240 seconds botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00277 seconds botty_1 | INFO:root:[Bot] Consumer #1 got new job in 0.00305 seconds botty_1 | INFO:root:[StopCommand()] stop triggered botty_1 | ERROR:root:[StopCommand] Error: 'Message' object has no attribute 'attachments_local_filenames' signal-cli-rest-api_1 | [GIN] 2025/02/06 - 07:45:01 | 204 | 1.205244521s | 192.168.224.3 | PUT "/v1/typing-indicator/<snip>"

@kevincw01
Copy link
Author

Also tried to access context.message.base64_attachments[0] and I get Error: list index out of range. Do I need to access the raw message in some way?

@kevincw01
Copy link
Author

just realized that pip installed 0.10 and the base64 attachments code was added in 0.11. pip install signalbot --upgrade doesn't fix it -- still shows v0.10. Any idea how I force pip to take the latest release?

@kevincw01
Copy link
Author

kevincw01 commented Feb 8, 2025

I was able to uninstall the old version on pypi and then reinstall directly from the git release which fixed it.

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

No branches or pull requests

1 participant