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

Populate Message extras url #6

Closed
jayvdb opened this issue Nov 26, 2017 · 1 comment
Closed

Populate Message extras url #6

jayvdb opened this issue Nov 26, 2017 · 1 comment

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Nov 26, 2017

The slack backend provides a Message.extras['url'] , which is a link to the message

        msg.extras['url'] = 'https://{domain}.slack.com/archives/{channelid}/p{ts}'.format(
            domain=self.sc.server.domain,
            channelid=channel_link_name,
            ts=self._ts_for_message(msg).replace('.', '')
        )

I've created a patch for Gitter backend to do the same : errbotio/err-backend-gitter#32

And ideally Zulip does as well.
It is reasonably easy to create the URL for a topic of a stream, but I suspect that the /near/id part is not available in the API. At least I couldnt find it quickly.

jayvdb added a commit to jayvdb/errbot-backend-zulip that referenced this issue Nov 26, 2017
Allow bots to easily refer to stream&topic that a message
was part of.

Closes zulip#6
@timabbott
Copy link
Member

@jayvdb you need the message ID (which should be available in the message object from the Zulip API) and then you can construct a URL with a /#narrow/stream/foo/topic/bar/near/ID structure (the operator/operand pairs can be in any order)

jayvdb added a commit to jayvdb/errbot-backend-zulip that referenced this issue Nov 27, 2017
Allow bots to easily refer to stream&topic that a message
was part of.

Closes zulip#6
jayvdb added a commit to jayvdb/errbot-backend-zulip that referenced this issue Nov 28, 2017
Allow bots to easily refer to stream&topic that a message
was part of.

Closes zulip#6
jayvdb added a commit to jayvdb/errbot-backend-zulip that referenced this issue Nov 28, 2017
Allow bots to easily refer to stream&topic that a message
was part of.

Closes zulip#6
jayvdb added a commit to jayvdb/errbot-backend-zulip that referenced this issue Nov 28, 2017
Allow bots to easily refer to stream&topic that a message
was part of.

Closes zulip#6
roberthoenig pushed a commit that referenced this issue Nov 28, 2017
Allow bots to easily refer to stream&topic that a message
was part of.

Closes #6
zmlaimeew added a commit to zmlaimeew/zulip that referenced this issue Jan 22, 2022
Allow bots to easily refer to stream&topic that a message
was part of.

Closes zulip/errbot-backend-zulip#6
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

2 participants