Pressing control-c while run.py is being executed has terminated the
script, but threw an ugly traceback. To signal the user that his
method of exit was appropriate, we handle control-c calling exit(0).
'contribot_bots' should only provide a restricted access to the
client API, yet 'client' and 'rate_limit were fully exposed. While
not fully restricting access to those objects, this commits hides
them with prepending underscores.
Now, the `Client.do_api_query()` method supports sending files to the
API.
This has allowed the implementation of a new method,
`Client.upload_file(file)`. It simply uploads the file set in the
parameter, and returns the API's response (that includes the URI).
Despite the fact that `do_api_query()` supports multiple files as
parameters, `upload_file()` doesn't, because right now the API isn't
capable of managing more than a file in the same request.
To prevent bots from accidently entering an infinite message loop,
where they send messages as a reacting to their own messages,
this commit adds the RateLimit class to run.py. It specifies how
many messages can be sent in a given time interval. If this rate
is exceeded, run.py exits with an error.
Fixes#3210.
Update integration to use the latest Google API client.
Move Google Account authorization code to a separate file.
Move relevant files from 'bots/' to 'api/integrations/google/'.
Add documentation for integration.
Now the development API (which is inside the repo, api/) is used when the envionment is a development one.
Credits to Steve Howell (@showell) for the instructions on how to fix this.
- Expose some information about user profile in `RestrictedClient`
class, like `full_name` and `email` of the user.
- Add `client` argument to `triage_message()`, now it's possible to
call bot with another method instead of calling the specified
keyword.