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

Create a callback for links and other attachments #14

Open
byrnereese opened this issue May 13, 2022 · 1 comment
Open

Create a callback for links and other attachments #14

byrnereese opened this issue May 13, 2022 · 1 comment

Comments

@byrnereese
Copy link

In my bot I have implemented unfurling. This is accomplished by scanning every incoming message for links, iterating over them, and then posting adaptive cards. What if this process could be abstracted?

The framework could throw an event "LinkAdded" whose handler would look like this

const handleLinks = async event => {
    const { group, bot, urls } = event
    for (url of urls) {
        // do stuff for url
    }
}

The point is: make it easier for developers to process links. The same could also be said for any type of message:

  • events
  • tasks
  • notes
  • code snippets
  • and so forth
@byrnereese
Copy link
Author

Another requirement... the framework when extracting URLs should be able to ignore URLs that are included in a response.

Imagine a user sends a URL in a message, then another responds to that message by quoting it. The first URL should be unfurled, but the second URL (really a duplicate of the first) should be ignore.

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