docs: Add Baremetrics to integrations

The baremetrics bot had existing documentation at zulip/python-zulip-api.
I added the existing markdown file as well as a logo and relevant assets
to appear on the /integrations page.
Followed existing documentation for webhook integrations.
Fixes #17534

fix lint tests

use path config

fix backend lint
This commit is contained in:
Sarah Sayce 2021-03-16 18:12:02 -04:00
parent b01d43f339
commit bad1029796
41 changed files with 1278 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,41 @@
# Baremetrics bot
The Baremetrics bot is a Zulip bot that gives updates about customer behavior, financial performance, and
analytics for an organization using the [Baremetrics](https://baremetrics.com/) API.
To use the Baremetrics bot, you can simply call it with `@<botname>` followed
by a command, like so:
```
@Baremetrics help
```
## Setup
Before usage, you will need to configure the bot by putting the value of the `<api_key>` in the config file.
To do this, follow the given steps:
1. Login at [Baremetrics Console](https://app.baremetrics.com/settings/api).
2. Note the `Live API Key`.
3. Open up `zulip_bots/bots/baremetrics/baremetrics.conf` in an editor and
change the value of the `<api_key>` attribute to the noted `Live API Key`.
## Developer Notes
Be sure to add the command and its description to their respective lists (named `commands` and `descriptions`)
so that it can be displayed with the other available commands using `@<botname> list-commands`. Also modify
the `test_list_commands_command` in `test_baremetrics.py`.
## Links
- [Baremetrics](https://baremetrics.com/)
- [Baremetrics Developer API](https://developers.baremetrics.com/reference)
- [Baremetrics Dashboard](https://app.baremetrics.com/setup)
## Usage
`@Baremetrics list-commands` - This command gives a list of all available commands along with short
short descriptions.
Example:
![](assets/list-commands.png)

View File

@ -0,0 +1,63 @@
# Beeminder bot
The Beeminder bot can help you adding datapoints towards
your Beeminder goal from Zulip.
To use the Beeminder bot, you can simply call it with `@beeminder`
followed by a daystamp, value and an optional comment.
Syntax is like:
```
@beeminder daystamp, value, comment
```
**NOTE** : **Commas** between inputs are a must, otherwise,
you'll get an error.
## Setup and Configuration
Before running Beeminder bot you will need three things as follows :
1. **auth_token**
- Go to your [Beeminder](https://www.beeminder.com/) **account settings**.
Under **APPS & API** section you will find your **auth token**.
2. **username**
- Your Beeminder username.
3. **Goalname**
- The name of your Beeminder goal for which you want to
add datapoints from [Zulip](https://zulipchat.com/)
Once you have above information, you should supply
them in `beeminder.conf` file.
Run this bot as described in
[here](https://zulipchat.com/api/running-bots#running-a-bot).
## Usage
You can give command to add datapoint in 4 ways:
1. `@beeminder daystamp, value, comment`
- Example usage: `@beeminder 20180125, 15, Adding datapoint`.
- This will add a datapoint to your Beeminder goal having
**daystamp**: `20180125`, **value**: `15` with
**comment**: `Adding datapoint`.
2. `@beeminder daystamp, value`
- Example usage: `@beeminder 20180125, 15`.
- This will add a datapoint in your Beeminder goal having
**daystamp**: `20180125`, **value**: `15` and **comment**: `None`.
3. `@beeminder value, comment`
- Example usage: `@beeminder 15, Adding datapoint`.
- This will add a datapoint in your Beeminder goal having
**daystamp**: `current daystamp`, **value**: `15` and **comment**: `Adding datapoint`.
4. `@beeminder value`
- Example usage: `@beeminder 15`.
- This will add a datapoint in your Beeminder goal having
**daystamp**: `current daystamp`, **value**: `15` and **comment**: `None`.
5. `@beeminder ` or `@beeminder help` will fetch you the `help message`.

View File

@ -0,0 +1,39 @@
## Starting a Game
You can start a game with another user by typing
```
start with other user
```
or you can start a game with a computer with
```
start as <white or black> with computer
```
## Playing
After starting the game, you can make your move by typing
```
do <your move>
```
using [Standard Algebraic Chess Notation](https://goo.gl/rehi8n). For example,
`do e4` to move a pawn to *e4* or `do Nf3` to move a night to *f3* or `do O-O`
to castle.
## Ending the game
The bot will detect if a game is over. You can end one early by resigning
with the
```
resign
```
command.
(Or you could just stop responding.)

View File

@ -0,0 +1,5 @@
# Connect Four Bot
The Connect Four bot is a Zulip bot that will allow users
to play a game of Connect Four against either another user,
or the computer.

View File

@ -0,0 +1,70 @@
# Converter bot
This bot allows users to perform conversions for various measurement units.
## Usage
Run this bot as described in [here](https://zulipchat.com/api/running-bots#running-a-bot).
Use this bot with the following command
`@convert <number> <unit_from> <unit_to>`
This will convert `number`, given in the unit `unit_from`, to the unit `unit_to`
and print the result.
* `number` can be any floating-point number, e.g. 12, 13.05, 0.002.
* `unit_from` and `unit_to` are two units from [the following](#supported-units) table in the same category.
* `unit_from` and `unit_to` can be preceded by [these](#supported-prefixes) prefixes.
### Supported units
| Category | Units |
| ----------------- | ----- |
| Area | square-centimeter (cm^2, cm2), square-decimeter (dm^2, dm2), square-meter (m^2, m2), square-kilometer (km^2, km2), square-inch (in^2, in2), square-foot (ft^2, ft2), square-yard (y^2, y2), square-mile (mi^2, mi2), are (a), hectare (ha), acre (ac) |
| Information | bit, byte |
| Length | centimeter (cm), decimeter (dm), meter (m), kilometer (km), inch (in), foot (ft), yard (y), mile (mi), nautical-mile (nmi) |
| Temperature | Kelvin (K), Celsius (C), Fahrenheit (F) |
| Volume | cubic-centimeter (cm^3, cm3), cubic-decimeter (dm^3, dm3), liter (l), cubic-meter (m^3, m3), cubic-inch (in^3, in3), fluid-ounce (fl-oz), cubic-foot (ft^3, ft3), cubic-yard (y^3, y3) |
| Weight | gram (g), kilogram (kg), ton (t), ounce (oz), pound (lb) |
| Cooking (metric only, U.S. and imperial units differ slightly) | teaspoon (tsp), tablespoon (tbsp), cup |
### Supported prefixes
| Prefix | Power of 10 |
| ------ | ----------- |
| atto | 10<sup>-18</sup> |
| pico | 10<sup>-15</sup> |
| femto | 10<sup>-12</sup> |
| nano | 10<sup>-9</sup> |
| micro | 10<sup>-6</sup> |
| milli | 10<sup>-3</sup> |
| centi | 10<sup>-2</sup> |
| deci | 10<sup>-1</sup> |
| deca | 10<sup>1</sup> |
| hecto | 10<sup>2</sup> |
| kilo | 10<sup>3</sup> |
| mega | 10<sup>6</sup> |
| giga | 10<sup>9</sup> |
| tera | 10<sup>12</sup> |
| peta | 10<sup>15</sup> |
| exa | 10<sup>18</sup> |
### Usage examples
| Message | Response |
| ------- | ------ |
| `@convert 12 celsius fahrenheit` | 12.0 celsius = 53.600054 fahrenheit |
| `@convert 0.002 kilomile millimeter` | 0.002 kilomile = 3218688.0 millimeter |
| `@convert 31.5 square-mile ha | 31.5 square-mile = 8158.4625 ha |
| `@convert 56 g lb` | 56.0 g = 0.12345887 lb |
## Notes
* You can use multiple `@convert` statements in a message, the response will look accordingly:
![multiple-converts](assets/multiple-converts.png)
* Enter `@convert help` to display a quick overview of the converter's functionality.
* For bits and bytes, the prefixes change the figure differently: 1 kilobyte is 1024 bytes,
1 megabyte is 1048576 bytes, etc.

View File

@ -0,0 +1,21 @@
# DefineBot
* This is a bot that defines a word that the user inputs. Whenever the user
inputs a message starting with '@define', the bot defines the word
that follows.
* The definitions are brought to the website using an API. The bot posts the
definition of the word to the stream from which the user inputs the message.
If the user inputs a word that does not exist or a word that is incorrect or
is not in the dictionary, the definition is not displayed.
* For example, if the user says "@define crash", all the meanings of crash
appear, each in a separate line.
![Correct Word](assets/correct_word.png)
* If the user enters a wrong word, like "@define cresh" or "@define crish",
then an error message saying no definition is available is displayed.
![Wrong Word](assets/wrong_word.png)

View File

@ -0,0 +1,24 @@
# DialogFlow bot
This bot allows users to easily add their own DialogFlow bots to zulip.
## Setup
To add your DialogFlow bot:
Add the V1 Client access token from your agent's settings in the DialogFlow console to
`dialogflow.conf`, and write a short sentence describing what your bot does in the same file
as `bot_info`.
## Usage
Run this bot as described
[here](https://zulipchat.com/api/running-bots#running-a-bot).
Mention the bot in order to say things to it.
For example: `@weather What is the weather today?`
## Limitations
When creating your DialogFlow bot, please consider these things:
- Empty input will not be sent to the bot.
- Only text can be sent to, and recieved from the bot.

View File

@ -0,0 +1,41 @@
# Dropbox Bot
This bot links your [dropbox](https://www.dropbox.com) account to [zulip](https://chat.zulip.org).
## Usage
- Create a dropbox app from [here](https://www.dropbox.com/developers/apps).
- Click the `generate` button under the **Generate access token** section.
- Copy the Access Token and paste it in a file named `dropbox_share.conf` as shown:
```
[dropbox_share]
ACCESS_TOKEN=<your_access_token>
```
- Follow the instructions as described in [here](https://zulipchat.com/api/running-bots#running-a-bot).
- Run the bot: `zulip-run-bot dropbox_share -b <Path/to/dropbox_share.conf> -c <Path/to/zuliprc>`
Use this bot with any of the following commands:
- `@dropbox mkdir` : Create a folder
- `@dropbox ls` : List contents of a folder
- `@dropbox write` : Save text to a file
- `@dropbox rm` : Remove a file/folder
- `@dropbox help` : See help text
- `@dropbox read`: Read contents of a file
- `@dropbox share`: Get a shareable link for a file/folder
- `@dropbox search`: Search for matching file/folder names
where `dropbox` may be the name of the bot you registered in the zulip system.
### Usage examples
- `dropbox ls -` Shows files/folders in the root folder.
- `dropbox mkdir foo` - Make folder named foo.
- `dropbox ls foo/boo` - Shows the files/folders in foo/boo folder.
- `dropbox write test hello world` - Write "hello world" to the file 'test'.
- `dropbox rm test` - Remove the file/folder test.
- `dropbox read foo` - Read the contents of file/folder foo.
- `dropbox share foo` - Get shareable link for the file/folder foo.
- `dropbox search boo` - Search for boo in root folder and get at max 20 results.
- `dropbox search boo --mr 10` - Search for boo and get at max 10 results.
- `dropbox search boo --fd foo` - Search for boo in folder foo.

View File

@ -0,0 +1,16 @@
About EncryptBot:
EncryptBot Allows for quick ROT13 encryption in the middle of a chat.
What It Does:
The bot encrypts any message sent to it on any stream it is subscribed to with ROT13.
How It Works:
The bot will Use ROT13(A -> N, B -> O... and vice-versa) in a python
implementation to provide quick and easy encryption.
How to Use:
-Send the message you want to encrypt, add @encrypt to the beginning.
-The Encrypted message will be sent back to the stream the original
message was posted in to the topic <sender-email>'s encrypted text.
-Messages can be decrypted by sending them to EncryptBot in the same way.

View File

@ -0,0 +1,21 @@
# File Uploader Bot
This bot allows the user to upload a file with a given path to the Zulip server.
## Usage
Use this bot with any of the following commands:
- `@uploader <local_file_path>` : Upload a file, where `<local_file_path>` is the path to the file
- `@uploader help` : Display help message
### Usage examples
The following command will upload the file `/tmp/image.png` to the Zulip server:
```
@**uploader** /tmp/image.png
```
Here's an example response:
> [image.png](https://server.zulipchat.com/user_uploads/3787/RgoZReSsfMjlQSzvVxjIgAQy/image.png)

View File

@ -0,0 +1,27 @@
# Flock Bot
With [Flock](https://flock.com/) bot, you can send messages to any of your
flock contact without having to leave Zulip.
Sending messages to a user is quite easy, syntax is:
`@botname recipient_name: hello`
where `recipient_name` is name of recipient and `hello` is the sample message.
## Configuration
1. Before running Flock bot, you'll need a `token`. In order to get `token`,
Go to [Flock apps](https://dev.flock.com/apps) and create an app.
After successful installation, you'll get an `token` in response from servers.
1. Once you have `token`, you should supply it in `flock.conf` file.
## Usage
Run this bot as described in
[here](https://zulipchat.com/api/running-bots#running-a-bot).
You can use this bot in one easy step:
`@botname recipient_firstName: message`
For help, do `@botname help`.

View File

@ -0,0 +1,17 @@
# Front Bot
## Setup
1. Go to the `Setting` of your Front app.
2. Copy the `JSON Web Token` from `Plugins & API``API`.
3. Replace `<api_key>` in `zulip_bots/bots/front/front.conf` with `JSON
Web Token`.
## Usage
![](assets/usage.png)
The name of the topic, from which you call the bot, must contain the ID of
the corresponding Front conversation. If you have received notifications
from this conversation using Front incoming webhook, you can use the topic
it has created.

View File

@ -0,0 +1,42 @@
# GIPHY bot
The GIPHY bot is a Zulip bot that can fetch a GIF associated with
a given keyword from [GIPHY](https://giphy.com/).
To use the GIPHY bot, you can simply call it with `@Giphy` followed
by a keyword, like so:
```
@Giphy hello
```
## Setup
Before you can proceed further, you'll need to go to the
[GIPHY Developers](https://developers.giphy.com/), and get a
GIPHY API key.
1. Click on the **Create an App** button on the top right corner.
2. Click on **Create an App** under the **Your Apps** section.
3. Enter a name and a description for your app and click on
**Create New App**.
4. And you're done! You should now have a GIPHY API key.
5. Open up `zulip_bots/bots/giphy/giphy.conf` in an editor and
and change the value of the `key` attribute to the API key
you generated above.
Run this bot as described in [here](https://zulipchat.com/api/running-bots#running-a-bot).
## Usage
1. `@Giphy <keyword` - This command will fetch a GIF associated
with the given keyword. Example usage: `@Giphy hello`:
![](/static/generated/bots/giphy/assets/giphy-gif-found.png)
2. If a GIF can't be found for a given keyword, the bot will
respond with an error message:
![](/static/generated/bots/giphy/assets/giphy-gif-not-found.png)
3. If there's a connection error, the bot will respond with an
error message:
![](/static/generated/bots/giphy/assets/giphy-connection-error.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -0,0 +1,20 @@
This bot links and details issues and pull requests.
To use it @-mention the bot then type an id:
Ids can be specified in three different forms:
- Id only: `#2000`
- Repository and id: `zulip#2000`
- Owner, repository and id `zulip/zulip#2000`
The id can occur at any time in the message. You
can also mention multiple ids in a single message. For example:
`@**GitHub Detail Bot** find me #5176 and zulip/zulip#4534 .`
You can configure a default owner and repository.
The configuration file should be located at `api/bots/github_detail/github_detail.conf`.
It should look like this:
```ini
[github_detail]
owner = <repository owner>
repo = <repository name>
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,23 @@
# Google Search bot
This bot allows users to do Google search queries and have the bot
respond with the first search result. It is by default set to the
highest safe-search setting.
## Usage
Run this bot as described
[here](https://zulipchat.com/api/running-bots#running-a-bot).
Use this bot with the following command
`@mentioned-bot <search terms>`
This will return the first link found by Google for `<search terms>`
and print the resulting URL.
If no `<search terms>` are entered, a help message is printed instead.
If there was an error in the process of running the search (socket
errors, Google search function failed, or general failures), an error
message is returned.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,26 @@
# Google Translate bot
The Google Translate bot uses Google Translate to translate
any text sent to it.
## Setup
This bot requires a google cloud API key. Create one
[here](https://support.google.com/cloud/answer/6158862?hl=en)
You should add this key to `googletranslate.conf`.
To run this bot, use:
`zulip-run-bots googletranslate -c <zuliprc file>
--bot-config-file <path to googletranslate.conf>`
## Usage
To use this bot, @-mention it like this:
`@-mention "<text>" <target language> <source language(Optional)>`
`text` must be in quotation marks, and `source language`
is optional.
If `source language` is not given, it will automatically detect your language.

View File

@ -0,0 +1,4 @@
Simple Zulip bot that will respond to any query with a "beep boop".
The helloworld bot is a boilerplate bot that can be used as a
template for more sophisticated/evolved Zulip bots.

View File

@ -0,0 +1,46 @@
# idonethis bot
The idonethis bot is a Zulip bot which allows interaction with [idonethis](https://idonethis.com/)
through Zulip. It can peform actions such as viewing teams, list entries and creating entries.
To use the bot simply @-mention the bot followed by a specific command. See the usage section
below for a list of available commands.
## Setup
Before proceeding further, ensure you have an idonethis account.
1. Go to [your idonethis settings](https://beta.idonethis.com/u/settings), scroll down
and copy your API token.
2. Open up `zulip_bots/bots/idonethis/idonethis.conf` in your favorite editor, and change
`api_key` to your API token.
3. Optionally, change the `default_team` value to your default team for creating new messages.
If this is not specified, a team will be required to be manually specified every time an entry is created.
Run this bot as described [here](https://zulipchat.com/api/running-bots#running-a-bot).
## Usage
`<team>` can either be the name or ID of a team.
* `@mention help` view this help message.
![](/static/generated/bots/idonethis/assets/idonethis-help.png)
* `@mention teams list` or `@mention list teams`
List all the teams.
![](/static/generated/bots/idonethis/assets/idonethis-list-teams.png)
* `@mention team info <team>`.
Show information about one `<team>`.
![](/static/generated/bots/idonethis/assets/idonethis-team-info.png)
* `@mention entries list` or `@mention list entries`.
List entries from any team
![](/static/generated/bots/idonethis/assets/idonethis-entries-all-teams.png)
* `@mention entries list <team>` or `@mention list entries <team>`
List all entries from `<team>`.
![](/static/generated/bots/idonethis/assets/idonethis-list-entries-specific-team.png)
* `@mention entries create` or `@mention new entry` or `@mention create entry`
or `@mention new entry` or `@mention i did`
Create a new entry. Optionally supply `--team=<team>` for teams with no spaces or `"--team=<team>"`
for teams with spaces. For example `@mention i did "--team=product team" something` will create a
new entry `something` for the product team.
![](/static/generated/bots/idonethis/assets/idonethis-new-entry.png)
![](/static/generated/bots/idonethis/assets/idonethis-new-entry-specific-team.png)

View File

@ -0,0 +1,6 @@
# Incrementor bot
This is a boilerplate bot that makes use of the
update_message function. For the first @-mention, it initially
replies with one message containing a `1`. Every time the bot
is @-mentioned, this number will be incremented in the same message.

View File

@ -0,0 +1,81 @@
# Jira Bot
## Setup
To use Jira Bot, first set up `jira.conf`. `jira.conf` takes 3 options:
- username (an email or username that can access your Jira),
- password (the password for that username), and
- domain (a domain like `example.atlassian.net`)
## Usage
### get
`get` takes in an issue key and sends back information about that issue. For example,
you:
> @**Jira Bot** get "BOTS-13"
Jira Bot:
> **Issue *BOTS-13*: Create Jira Bot**
>
> - Type: *Task*
> - Description:
> > Jira Bot would connect to Jira.
> - Creator: *admin*
> - Project: *Bots*
> - Priority: *Medium*
> - Status: *To Do*
### create
`create` creates an issue using its
- summary,
- project,
- type,
- description *(optional)*,
- assignee *(optional)*,
- priority *(optional)*,
- labels *(optional)*, and
- due date *(optional)*
For example, to create an issue with every option,
you:
> @**Jira Bot** create issue "Make an issue" in project "BOTS"' with type "Task" with description
> "This is a description" assigned to "skunkmb" with priority "Medium" labeled "issues, testing"
> due "2017-01-23"
Jira Bot:
> Issue *BOTS-16* is up! https://example.atlassian.net/browse/BOTS-16
### edit
`edit` is like create, but changes an existing issue using its
- summary,
- project *(optional)*,
- type *(optional)*,
- description *(optional)*,
- assignee *(optional)*,
- priority *(optional)*,
- labels *(optional)*, and
- due date *(optional)*.
For example, to change every part of an issue,
you:
> @**Jira Bot** edit issue "BOTS-16" to use summary "Change the summary" to use project
> "NEWBOTS" to use type "Bug" to use description "This is a new description" by assigning
> to "admin" to use priority "Low" by labeling "new, labels" by making due "2018-12-5"
Jira Bot:
> Issue *BOTS-16* was edited! https://example.atlassian.net/browse/BOTS-16

View File

@ -0,0 +1,19 @@
# Link Shortener Bot
Link Shortener Bot is a Zulip bot that will shorten URLs ("links") in a
conversation. It uses the [bitly URL shortener API] to shorten its links.
Use [this](https://dev.bitly.com/get_started.html) to get your API Key.
Links can be anywhere in the message, for example,
> @**Link Shortener Bot** @**Joe Smith** See
> https://github.com/zulip/python-zulip-api/tree/master/zulip_bots/zulip_bots/bots
> for a list of all Zulip bots.
and LS Bot would respond
> https://github.com/zulip/python-zulip-api/tree/master/zulip_bots/zulip_bots/bots:
> **https://bit.ly/2FF3QHu**
[bitly URL shortener API]: https://bitly.com/

View File

@ -0,0 +1,32 @@
# Mention bot
The Mention bot is a Zulip bot that can fetch Mentions associated with
a given keyword from the web using [Mention](https://mention.com/en/).
To use the Mention bot, you can simply call it with `@<botname>` followed
by a keyword, like so:
```
@Mention Apple
```
## Setup
Before you can proceed further, you'll need to go to the
[Mention Dev](https://dev.mention.com/login), and get a
Mention API Access Token.
1. Login.
2. Enter the **App Name**, **Description**, **Website**, and **Redirect uris**. In this version, there
is no actual use of the Redirect Uri and Website.
3. After accepting the agreement, click on **Create New App**.
4. And you're done! You should now have an Access Token.
5. Open up `zulip_bots/bots/mention/mention.conf` in an editor and
change the value of the `<access_token>` attribute to the Access Token
you generated above.
## Usage
`@Mention <keyword>` - This command will fetch the most recent 20
mentions of the keyword on the web (Limitations of a free account).
Example:
![](assets/mentions_demo.png)

View File

@ -0,0 +1,65 @@
# monkeytest.it bot
## Overview
This bot provides a quick way to check a site from a chat.
Using their monkeytestit's API key, the user can check a website
for certain failures that user wants to see.
## Setting up API key
1. Get your monkeytest.it API key, located in your
[dashboard](https://monkeytest.it/dashboard).
2. Create your own `monkeytestit.conf` file by copying the existing one in
`bots/monkeytest/monkeytestit.conf`.
3. Inside the config file, you will see this:
```
[monkeytestit]
api_key = <api key here>
```
4. Replace `<api key here>` with your API key
5. Save the configuration file.
## Running the bot
Let `<path_to_config>` be the path to the config file, and let
`<path_to_zuliprc>` be the path to the zuliprc file.
You can run the bot by running:
`zulip-run-bot -b <path_to_config> monkeytestit --config-file
<path_to_zuliprc>`
## Usage
**Note**: You **must** not forget to put `http://` or `https://`
before a website. Otherwise, the check will fail.
### Simple check with default settings
To check a website with all enabled checkers, run:
`check https://website`
### Check with options
To check a website with certain enabled checkers, run:
`check https://website <checker_options>`
The checker options are supplied to: `on_load`, `on_click`, `page_weight`,
`seo`, `broken_links`, `asset_count` **in order**.
Example 1: Disable `on_load`, enable the rest
command: `check https://website 0`
Example 2: Disable `asset_count`, enable the rest
command: `check https//website 1 1 1 1 1 0`
Example 3: Disable `on_load` and `page_weight`, enable the rest
command: `check https://website 0 1 0`
So for instance, if you wanted to disable `asset_count`, you have
to supply every params before it.

View File

@ -0,0 +1,80 @@
# Salesforce bot
The Salesforce bot can get records from your Salesforce database.
It can also show details about any Salesforce links that you post.
## Setup
1. Create a user in Salesforce that the bot can use to access Salesforce.
Make sure it has the appropriate permissions to access records.
2. In `salesforce.conf` paste the Salesforce `username`, `password` and
`security_token`.
3. Run the bot as explained [here](https://zulipchat.com/api/running-bots#running-a-bot)
## Examples
### Standard query
![Standard query](assets/query_example.png)
### Custom query
![Custom query](assets/top_opportunities_example.png)
### Link details
![Link details](assets/link_details_example.png)
## Optional Configuration (Advanced)
The bot has been designed to be able to configure custom commands and objects.
If you wanted to find a custom object type, or an object type not included with the bot,
like `Event`, you can add these by adding to the Commands and Object Types in `utils.py`.
A Command is a phrase that the User asks the bot. For example `find contact bob`. To make a Command,
the corresponding object type must be made.
Object types are Salesforce objects, like `Event`, and are used to tell the bot which fields of the object the bot
should ask for and display.
To show details about a link posted, only the Object Type for the object needs to be present.
Please read the
[SOQL reference](https://goo.gl/6VwBV3)
to make custom queries, and the [simple_salesforce documentation](https://pypi.python.org/pypi/simple-salesforce)
to make custom callbacks.
### Commands
For example: "find contact tim"
In `utils.py`, the commands are stored in the list `commands`.
Parameter | Required? | Type | Description | Default
--------- | --------- | ---- | ----------- | -------
commands | [x] | list[str] | What the user should start their command with | `None`
object | [x] | str | The Salesforce object type in `object_types` | `None`
query | [ ] | str | The SOQL query to access this object* | `'SELECT {} FROM {} WHERE Name LIKE %\'{}\'% LIMIT {}'`
description | [x] | str | What does the command do? | `None`
template | [x] | str | Example of the command | `None`
rank_output | [ ] | boolean | Should the output be ranked? (1., 2., 3. etc.) | `False`
force_keys | [ ] | list[str] | Values which should always be shown in the output | `[]`
callback | [ ] | callable** | Custom handling behaviour | `None`
**Note**: *`query` must have `LIMIT {}` at the end, and the 4 parameters are `fields`, `table` (from `object_types`),
`args` (the search term), `limit` (the maximum number of terms)
**`callback` must be a function which accepts `args: str`(arguments passed in by the user, including search term),
`sf: simple_salesforce.api.Salesforce` (the Salesforce handler object, `self.sf`), `command: Dict[str, Any]`
(the command used from `commands`)
### Object Types
In `utils.py` the object types are stored in the dictionary `object_types`.
The name of each object type corresponds to the `object` referenced in `commands`.
Parameter | Required? | Type | Description
--------- | --------- | ---- | -----------
fields* | [x] | str | The Salesforce fields to fetch from the database.
name | [x] | str | The API name of the object**.
**Note**: * This must contain Name and Id, however Id is not displayed.
** Found in the salesforce object manager.

View File

@ -0,0 +1,41 @@
# StackOverflow Bot
The StackOverflow bot is a Zulip bot that will search Stackoverflow
for a provided set of keywords or a question, and fetch a link to the associated
query. The link is returned to the same stream
it was @mentioned in
The Stackoverflow bot uses the
[StackExchange API](http://api.stackexchange.com/docs)
to obtain the search results it returns
Using the StackOverflow bot is as simple as mentioning @\<stackoverflow-bot-name\>,
followed by the query:
```
@<stackoverflow-bot-name> <query>
```
## Setup
Beyond the typical obtaining of the zuliprc file, no extra setup is required to use the StackOverflow Bot
## Usage
1. ```@<stackoverflow-bot-name> <query>``` -
fetches the link to the appropriate StackOverflow questions.
* For example, `@<stackoverflow-bot-name> rest api`
will return the links having questions related to rest api.
<br>
2. If there are no questions related to the query,
the bot will respond with an error message:
`I am sorry. The search query you provided is does not have any related results.`
<br>
3. If no query is provided, the bot will return the help text:
```Please enter your message after @mention-bot```

View File

@ -0,0 +1,37 @@
# Tic-Tac-Toe Bot
This bot allows you to play tic-tac-toe in a private message with the bot.
Multiple games can simultaneously be played by different users, each playing
against the computer.
The bot only responds to messages starting with @mention of the bot(botname).
## Setup
This bot does not require any special setup. Just run it according to the
instructions in [this guide](https://zulipchat.com/api/running-bots#running-a-bot).
## Commands
* `@mention-botname new` - start a new game (but not if you are already
playing a game.) You must type this first to start playing!
* `@mention-botname help` - return a help message.
* `@mention-botname quit` - quit the current game.
* `@mention-botname <coordinate>` - make a move at the entered coordinate.
For example, `@mention-botname 1,1` . After this, the bot will make its
move, or declare the game over if the user or bot has won.
Coordinates are entered in a (row, column) format. Numbering is from top to
bottom and left to right.
Here are the coordinates of each position. When entering coordinates, parentheses
and spaces are optional.
(1, 1) | (1, 2) | (1, 3)
(2, 1) | (2, 2) | (2, 3)
(3, 1) | (3, 2) | (3, 3)
Invalid commands will result in an "I don't understand" response from the bot,
with a suggestion to type `@mention-botname help`.

View File

@ -0,0 +1,41 @@
# Trello bot
The Trello bot is a Zulip bot that enables interaction with Trello using the
[Trello API](https://developers.trello.com).
To use the Trello bot, you can simply call it with `@<botname>` followed
by a command, like so:
```
@Trello help
```
## Setup
Before usage, you will need to configure the bot by putting the value of the `<api_key>`,
`<access_token>`, and `<user_name>` in the config file.
To do this, follow the given steps:
1. Go to [this]( https://trello.com/app-key) link after logging in at
[Trello]( https://trello.com/).
2. Generate an `access_token` and note it down. Continue to get your
`api_key`.
3. Go to your profile page in Trello and note down your `username`.
4. Open up `zulip_bots/bots/trello/trello.conf` in an editor and
change the values of the `<api_key>`, `<access_token>`, and `<user_name>`
attributes to the corresponding noted values.
## Developer Notes
Be sure to add the additional commands and their descriptions to the `supported_commands`
list in `trello.py` so that they can be displayed with the other available commands using
`@<botname> list-commands`. Also modify the `test_list_commands_command` in
`test_trello.py`.
## Usage
`@Trello list-commands` - This command gives a list of all available commands along with
short descriptions.
Example:
![](assets/list_commands.png)

View File

@ -0,0 +1,44 @@
# Virtual fs bot
This bot allows users to store information in a virtual file system,
for a given stream or private chat.
## Usage
Run this bot as described in
[here](https://zulipchat.com/api/running-bots#running-a-bot).
Use this bot with any of the following commands:
`@fs mkdir` : create a directory
`@fs ls` : list a directory
`@fs cd` : change directory
`@fs pwd` : show current path
`@fs write` : write text
`@fs read` : read text
`@fs rm` : remove a file
`@fs rmdir` : remove a directory
where `fs` may be the name of the bot you registered in the zulip system.
### Usage examples
`@fs ls` - Initially shows nothing (with a warning)
`@fs pwd` - Show which directory we are in: we start in /
`@fs mkdir foo` - Make directory foo
`@fs ls` - Show that foo is now created
`@fs cd foo` - Change into foo (and do a pwd, automatically)
`@fs write test hello world` - Write "hello world" to the file 'test'
`@fs read test` - Check the text was written
`@fs ls` - Show that the new file exists
`@fs rm test` - Remove that file
`@fs cd /` - Change back to root directory
`@fs rmdir foo` - Remove foo
## Notes
* In a stream, the bot must be mentioned; in a private chat, the bot
will assume every message is a command and so does not require this,
though doing so will still work.
* Use commands like `@fs help write` for more details on a command.

View File

@ -0,0 +1,16 @@
# WeatherBot
* This is a bot that sends weather information to a selected stream on
request.
* Weather information is brought to the website using an
OpenWeatherMap API. The bot posts the weather information to the
stream from which the user inputs the message. If the user inputs a
city that does not exist, the bot displays a "Sorry, city not found"
message.
* Before using this bot, you have to generate an OpenWeatherMap API
key and replace the dummy value in weather.conf.
![Example Usage](assets/screen1.png)
![Wrong City](assets/screen2.png)

View File

@ -0,0 +1,41 @@
# Wikipedia Bot
The Wikipedia bot is a Zulip bot that will search Wikipedia
for a provided keyword, and fetch a link to the associated
Wikipedia article. The link is returned to the same stream
it was @mentioned in
The Wikipedia bot uses the
[MediaWiki API](https://www.mediawiki.org/wiki/API:Main_page)
to obtain the search results it returns
Using the Wikipedia bot is as simple as mentioning @\<wikipedia-bot-name\>,
followed by the keyword:
```
@<wikipedia-bot-name> <keyword>
```
## Setup
Beyond the typical obtaining of the zuliprc file, no extra setup is required to use the Wikipedia Bot
## Usage
1. ```@<wikipedia-bot-name> <keyword>``` -
fetches the link to the appropriate Wikipedia article.
* For example, `@<wikipedia-bot-name> Zulip`
will return the link `https://en.wikipedia.org/wiki/Zulip`
<br>
2. If the keyword does not return an article link,
the bot will respond with an error message:
`I am sorry. The search term you provided is not found`
<br>
3. If no keyword is provided, the bot will return the help text:
```Please enter your message after @mention-bot```

View File

@ -0,0 +1,52 @@
# Wit.ai Bot
Wit.ai Bot uses [wit.ai](https://wit.ai/) to parse natural language.
## Usage
1. Go to https://wit.ai/ and sign up.
2. Create your Wit.ai app, or follow
[this quickstart guide](https://wit.ai/docs/quickstart).
3. Create a `.conf` file containing a `token` field for your Wit.ai token,
and a `help_message` field for a message to display to confused users,
e.g.,
```
[witai]
token = QWERTYUIOP1234
help_message = Ask me about my favorite food!
```
4. Create a new file named `witai_handler.py`, and inside of it, create a
function called `handle` with one parameter `response`. Inside of `handle`,
write code for whatever you want to do with the Wit.ai response. It should
return a `string` to respond to the user with. For example,
```python
def handle(response):
if response['entities']['intent'][0]['value'] == 'favorite_food':
return 'pizza'
if response['entities']['intent'][0]['value'] == 'favorite_drink':
return 'coffee'
```
5. Add `witai_handler.py`'s location as `handler_location` in your
configuration file, e.g.,
```
[witai]
token = QWERTYUIOP1234
handler_location = /Users/you/witai_handler_directory/witai_handler.py
```
6. Call
```bash
zulip-run-bot witai \
--config-file <your zuliprc> \
--bot-config-file <the config file>
```
to start the bot.

View File

@ -0,0 +1,37 @@
xkcd bot is a Zulip bot that can fetch a comic strip from xkcd. To use
the xkcd bot, you can simply call it with `@xkcd` followed by a command,
like so:
```
@xkcd <command>
```
Run this bot as described in [here](https://zulipchat.com/api/running-bots#running-a-bot).
### Usage
The xkcd bot has four commands:
1. `help` - This command is used to list all commands that can be used
with this bot. Example usage: `@xkcd help`:
![](/static/generated/bots/xkcd/assets/xkcd-help.png)
2. `latest` - This command is used to fetch the latest comic strip from
xkcd. Example usage: `@xkcd latest`:
![](/static/generated/bots/xkcd/assets/xkcd-latest.png)
3. `random`- This command is used to fetch a random comic strip from xkcd.
Example usage: `@xkcd random`:
![](/static/generated/bots/xkcd/assets/xkcd-random.png)
4. `<comic_id>` - To fetch a comic strip based on ID, you can supply the
ID to the bot as a parameter (`@xkcd <comic_id>`). For example, if you
want to fetch a comic strip with ID 1234, type `@xkcd 1234`:
![](/static/generated/bots/xkcd/assets/xkcd-specific-id.png)
If the ID requested doesn't exist, the bot will post a message that
the comic strip associated with that ID is not available, like so:
![](/static/generated/bots/xkcd/assets/xkcd-wrong-id.png)
5. If you type a command that isn't recognized by the bot, it will respond
the information printed by the `@xkcd help` command:
![](/static/generated/bots/xkcd/assets/xkcd-wrong-command.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,68 @@
# Overview
This is the documentation for how to set up and run the yoda bot. (`yoda.py`)
This directory contains library code for running Zulip
bots that react to messages sent by users.
This bot will allow users to translate a sentence into 'Yoda speak'.
It looks for messages starting with at-mention of the botname. You will need to have a
Mashape API key. Please see instructions for getting one below.
## Setup
Before running this bot, make sure to get a Mashape API key.
Go to this link:
<https://market.mashape.com/ismaelc/yoda-speak/overview>
This is the API that powers the `yoda`. You can read more about it
on this page.
![yoda api overview](assets/yoda-speak-api.png)
Click on the **Sign Up Free** button at the top and create
an account. Then click on the **Documentation** tab. Scroll down to the
bottom, and click on the **Test Endpoint** button.
This will add the Yoda Speak API to your default application. You can
also add it to a different application if you wish. Now click on the
**Applications** tab at the top. Select the application that you added
the Yoda Speak API to. Click on the blue **GET THE KEYS** button.
On the pop-up that comes up, click on the **COPY** button.
This is your Mashape API key. It is used
to authenticate. Store it in the `yoda.conf` file in the bot's
directory.
Example input:
@mention-bot You will learn how to speak like me someday.
If you need help while the bot is running just input `@mention-bot help`.
## Running the bot
Here is an example of running the "yoda" bot from
inside a Zulip repo:
cd ~/zulip/api
zulip-run-bot yoda --config-file ~/.zuliprc-prod
Once the bot code starts running, you will see a
message explaining how to use the bot, as well as
some log messages. You can use the `--quiet` option
to suppress some of the informational messages.
The bot code will run continuously until you kill them with
control-C (or otherwise).
### Configuration
For this document we assume you have some prior experience
with using the Zulip API, but here is a quick review of
what a `.zuliprc` files looks like. You can connect to the
API as your own human user, or you can go into the Zulip settings
page to create a user-owned bot.
[api]
email=someuser@example.com
key=<your api key>
site=https://zulip.somewhere.com

View File

@ -0,0 +1,65 @@
# YouTube bot
The YouTube bot is a Zulip bot that can search for videos from [YouTube](https://www.youtube.com/).
To use the YouTube bot, you can simply call it with `@YouTube` followed
by a keyword(s), like so:
```
@YouTube funny cats
```
## Setup
Before starting you will need a Developer's API key to run the bot.
To obtain a API key, follow the following steps :
1. Create a project in the [Google Developers Console](https://console.developers.google.com/)
2. Open the [API Library](https://console.developers.google.com/apis/library?project=_)
in the Google Developers Console. If prompted, select a project or create a new one.
In the list of APIs, select `Youtube Data API v3` and make sure it is enabled .
3. Open the [Credentials](https://console.developers.google.com/apis/credentials?project=_) page.
4. In the Credentials page , select *Create Credentials > API key*
5. Open `zulip_bots/bots/youtube/youtube.conf` in an editor and
and change the value of the `key` attribute to the API key
you generated above.
6. And that's it ! See Configuration section on configuring the bot.
## Configuration
This section explains the usage of options `youtube.conf` file in configuring the bot.
- `key` - Used for setting the API key. See the above section on setting up the bot.
- `number_of_results` - The maximum number of videos to show when searching
for a list of videos with the `@YouTube list <keyword>` command.
- `video_region` - The location to be used for searching.
The bot shows only the videos that are available in the given `<video_region>`
Run this bot as described in [here](https://zulipchat.com/api/running-bots#running-a-bot).
## Usage
1. `@YouTube <keyword>`
- This command search YouTube with the given keyword and gives the top result of the search.
This can also be done with the command `@YouTube top <keyword>`
- Example usage: `@YouTube funny cats` , `@YouTube top funny dogs`
![](/static/generated/bots/youtube/assets/youtube-search.png)
2. `@YouTube list <keyword>`
- This command search YouTube with the given keyword and gives a list of videos associated with the keyword.
- Example usage: `@YouTube list origami`
![](/static/generated/bots/youtube/assets/youtube-list.png)
2. If a video can't be found for a given keyword, the bot will
respond with an error message
![](/static/generated/bots/youtube/assets/youtube-not-found.png)
3. If there's a error while searching, the bot will respond with an
error message
![](/static/generated/bots/youtube/assets/youtube-error.png)

View File

@ -573,6 +573,13 @@ BOT_INTEGRATIONS: List[BotIntegration] = [
BotIntegration(
"xkcd", ["bots", "misc"], display_name="xkcd", logo="images/integrations/logos/xkcd.png"
),
BotIntegration(
"baremetrics",
["bots"],
display_name="Baremetrics",
logo="images/integrations/logos/baremetrics.png",
doc="../../tools/setup/static/generated/bots/baremetrics/doc.md",
),
]
HUBOT_INTEGRATIONS: List[HubotIntegration] = [