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

Initial Support for messages with file attachments #50

Closed
wants to merge 1 commit into from

Conversation

mochipon
Copy link

@mochipon mochipon commented Mar 5, 2024

This Pull Request introduces basic support for the 'share' verb, enabling the handling of messages with file attachments.

A key point to note is that there are two patterns of messages with files: those that come with text and those that are sent without any text, containing only the file(s).

For messages without text, the message object retrieved by self.teams.messages.get(message_base_64_id) does not contain a text. An example of such a message object is as follows:

{
  "id": "<snip>",
  "roomId": "<snip>",
  "roomType": "direct",
  "files": [
    "https://webexapis.com/v1/contents/<snip>"
  ],
  "personId": "<snip>",
  "personEmail": "<snip>",
  "created": "2024-03-05T03:46:01.711Z",
  "isVoiceClip": false
}

When a command is not understood or is absent, the help_command is invoked. So it's important to remember that the help_command will be always executed when a message contains only a file, with no accompanying text.

While I believe there may be a better approach, this PR serves to implement the necessary minimum support. Further improvements can be built upon this foundation.

Please review the changes, and if there are any additional considerations or modifications needed, please let me know. Thank you!

potentially fixes #38

@mochipon mochipon changed the title Initial Support for 'share' verb Initial Support for messages with file attachments Mar 5, 2024
@ecoen66
Copy link
Contributor

ecoen66 commented Apr 9, 2024

See pull request #54

@fbradyirl fbradyirl closed this Apr 24, 2024
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

Successfully merging this pull request may close these issues.

Bot not responding to messages with attachments (no log output either).
3 participants