Stream: GCI announce

Topic: contrib_bot Update


view this post on Zulip Rafid Aslam (Dec 26 2016 at 18:57):

Heyo Folks, for those who working on interactive bots task, just now we've merged an commit about interactive bots to master: 947fdf . That commit adds client argument to triage_message() of every bot codes. So please rebase your bot code to the latest build of master and add client argument to your bot's triage_message().
Also, this allows us to access name and email address of the bot account, by accessing:

view this post on Zulip Tim Abbott (Dec 26 2016 at 18:58):

cool!

view this post on Zulip Yago González (Dec 26 2016 at 18:59):

Thanks for the heads-up, @Rafid Aslam!

view this post on Zulip Steve Howell (showell) (Dec 26 2016 at 18:59):

Another enhancement forrun.py may be to make it fail fast somehow when your configuration is broken. This may require modifications to the API.

view this post on Zulip Rafid Aslam (Dec 26 2016 at 19:08):

@Steve Howell so that enhancement is not implemented yet ?

view this post on Zulip Yago González (Dec 26 2016 at 19:21):

@Steve Howell Remember what we talked in #GCI general (Importing 'zerver' stream)?

view this post on Zulip Yago González (Dec 26 2016 at 19:21):

It was about adding the client's do_api_query() method to the RestrictedClient, in order to be able to do queries to the API. In my case I needed it for uploading images, but I guess it could be pretty useful for other purposes.

view this post on Zulip Yago González (Dec 26 2016 at 19:22):

If you still think it's a good idea, I could create a PR too

view this post on Zulip Joshua Pan (Dec 26 2016 at 19:27):

How about all the current bots in /contrib_bots, don't they need to be changed also?

view this post on Zulip Yago González (Dec 26 2016 at 19:29):

Looks like Rafid already got rid of that, too. All of them have been updated (look at the commit he linked to) :)

view this post on Zulip Joshua Pan (Dec 26 2016 at 19:29):

:ok_hand:

view this post on Zulip Robert Hönig (Dec 26 2016 at 23:08):

I just created a PR in order to update the documentation on developing bots to contain the new feature.

view this post on Zulip Robert Hönig (Dec 26 2016 at 23:09):

Also, I noticed that the new client object in triage_message contains the function client.send_message as well. This is surely not desirable, as we do not want to send any messages in triage_message

view this post on Zulip Joshua Pan (Dec 26 2016 at 23:11):

@Robert Hönig looked at your PR. Looks good.

view this post on Zulip Joshua Pan (Dec 26 2016 at 23:11):

I also think that client.send_message is not needed, since the message already has it.

view this post on Zulip Robert Hönig (Dec 26 2016 at 23:21):

@Joshua Pan I just had a glance at the code. In order to remove client.send_message from the object, I think that it would be necessary to create a new object. Should I do that in another PR?

view this post on Zulip Joshua Pan (Dec 26 2016 at 23:23):

Yea, definitely. Keep the two commits in two different PRs.

view this post on Zulip Robert Hönig (Dec 26 2016 at 23:26):

okay :) the checks for the first PR have passed, can you merge it?

view this post on Zulip Tim Abbott (Dec 26 2016 at 23:27):

@Robert Hönig that's https://github.com/zulip/zulip/pull/2929/files?

view this post on Zulip Robert Hönig (Dec 26 2016 at 23:28):

yep :)

view this post on Zulip Robert Hönig (Dec 27 2016 at 00:12):

thanks for merging @Tim Abbott!

view this post on Zulip Steve Howell (showell) (Dec 28 2016 at 15:22):

Ideally that parameter would be called something more like client_info.


Last updated: Jul 19 2022 at 08:22 UTC