Skip to content

Commit 8adf518

Browse files
eeshangargtimabbott
authored andcommitted
bots/xkcd: Improve and refactor doc.md to use Markdown macros.
This commit does the following: * Minor improvements to the writing wherever possible. * Replace links to screenshots with links that would work when rendering said screenshots on the main repo. This would mean the screenshots won't be rendered outside the main repo. * Adds a section that links to our Bots Guide's How to run a bot tutorial by using a Markdown a macro.
1 parent 4a162ba commit 8adf518

File tree

1 file changed

+32
-33
lines changed
  • zulip_bots/zulip_bots/bots/xkcd

1 file changed

+32
-33
lines changed
Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
# xkcd bot
22

3-
xkcd bot is a Zulip bot that can fetch a comic strip from xkcd. To use xkcd
4-
bot you can simply call it with `@xkcd` followed by a command. Like this:
3+
xkcd bot is a Zulip bot that can fetch a comic strip from xkcd. To use
4+
the xkcd bot, you can simply call it with `@xkcd` followed by a command,
5+
like so:
56

67
```
78
@xkcd <command>
89
```
910

10-
xkcd bot has four commands:
11-
12-
1. `help`
13-
This command is used to list all commands that can be used with this bot.
14-
You can use this command by typing `@xkcd help` in a stream.
15-
![](assets/xkcd-help.png)
16-
17-
2. `latest`
18-
This command is used to fetch the latest comic strip from xkcd. You can use
19-
this command by typing `@xkcd latest` in a stream.
20-
![](assets/xkcd-latest.png)
21-
22-
3. `random`
23-
This command is used to fetch a random comic strip from xkcd. You can use
24-
this command by typing `@xkcd random` in a stream, xkcd bot will post a
25-
random xkcd comic strip.
26-
![](assets/xkcd-random.png)
27-
28-
4. `<comic_id>`
29-
To fetch a comic strip based on id, you can directly use `@xkcd <comic_id>`,
30-
for example if you want to fetch a comic strip with id 1234, you can type
31-
`@xkcd 1234`, xkcd bot will post a comic strip with id 1234.
32-
![](assets/xkcd-specific-id.png)
33-
34-
If you type a wrong command to xkcd bot, xkcd bot will post information
35-
you'd get from `@xkcd help`.
36-
![](assets/xkcd-wrong-command.png)
37-
38-
And if you type a wrong id, xkcd bot will post a message that an xkcd comic
39-
strip with that id is not available.
40-
![](assets/xkcd-wrong-id.png)
11+
{!running-a-bot.md!}
12+
13+
## Usage
14+
15+
The xkcd bot has four commands:
16+
17+
1. `help` - This command is used to list all commands that can be used
18+
with this bot. Example usage: `@xkcd help`:
19+
![](/static/generated/bots/xkcd/assets/xkcd-help.png)
20+
21+
2. `latest` - This command is used to fetch the latest comic strip from
22+
xkcd. Example usage: `@xkcd latest`:
23+
![](/static/generated/bots/xkcd/assets/xkcd-latest.png)
24+
25+
3. `random`- This command is used to fetch a random comic strip from xkcd.
26+
Example usage: `@xkcd random`:
27+
![](/static/generated/bots/xkcd/assets/xkcd-random.png)
28+
29+
4. `<comic_id>` - To fetch a comic strip based on ID, you can supply the
30+
ID to the bot as a parameter (`@xkcd <comic_id>`). For example, if you
31+
want to fetch a comic strip with ID 1234, type `@xkcd 1234`:
32+
![](/static/generated/bots/xkcd/assets/xkcd-specific-id.png)
33+
If the ID requested doesn't exist, the bot will post a message that
34+
the comic strip associated with that ID is not available, like so:
35+
![](/static/generated/bots/xkcd/assets/xkcd-wrong-id.png)
36+
37+
5. If you type a command that isn't recognized by the bot, it will respond
38+
the information printed by the `@xkcd help` command:
39+
![](/static/generated/bots/xkcd/assets/xkcd-wrong-command.png)

0 commit comments

Comments
 (0)