Skip to content

Commit dd9b5a4

Browse files
authored
Merge pull request #11 from csp-community/tkp/docs
Update documentation
2 parents 26f5299 + 3f11d95 commit dd9b5a4

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,40 @@ Miscellaneous commands for csp-bot
99

1010
## Overview
1111

12+
This package contains fun, testing, and utility commands for [csp-bot](http://github.com/Point72/csp-bot/).
13+
14+
| Command | Type | Description |
15+
| :----------- | :-------- | :--------------------------------------------------------------------------------------------------- |
16+
| `/slap` | `fun` | Slap someone with a [wet trout](https://en.wikipedia.org/wiki/Wikipedia:Whacking_with_a_wet_trout) |
17+
| `/mets` | `utility` | Get information about the NY Mets baseball team, including roster, players, and schedule information |
18+
| `/thanks` | `fun` | Thank another user with a random object or cash |
19+
| `/_fun` | `fun` | Randomly generated/selected quotes or trivia |
20+
| `/delaytest` | `test` | Tester command for delayed/repeated commands |
21+
22+
Any of these commands can be included in a `csp-bot` configuration [following the documentation](https://github.com/Point72/csp-bot/wiki/Overview#writing-commands):
23+
24+
```yaml
25+
# @package _global_
26+
defaults:
27+
- /gateway: slack
28+
- _self_
29+
30+
bot_name: CSP Bot
31+
app_token: .slack_app_token
32+
bot_token: .slack_bot_token
33+
34+
gateway:
35+
_target_: csp_bot.Gateway
36+
modules:
37+
- /modules/bot
38+
commands:
39+
- /commands/help
40+
- _target_: csp_bot_commands.DelayTestCommandModel
41+
- _target_: csp_bot_commands.FunCommandModel
42+
- _target_: csp_bot_commands.MetsCommandModel
43+
- _target_: csp_bot_commands.ThanksCommandModel
44+
- _target_: csp_bot_commands.TroutSlapCommandModel
45+
```
1246
1347
> [!NOTE]
1448
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).

csp_bot_commands/mets.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@
33

44
from csp_bot import BaseCommand, BaseCommandModel, BotCommand, Message, ReplyToOtherCommand
55

6+
log = logging.getLogger(__name__)
7+
68
try:
79
import lxml # noqa: F401
810
import pandas
911

1012
# Required for pandas functions we use
1113
import tabulate # noqa: F401
1214
except ModuleNotFoundError:
15+
# If pandas is not installed, we set it to None
1316
pandas = None
1417

18+
# Log a warning if pandas is not available
19+
log.warning("pandas is not installed, `/mets` commands will not function properly.")
20+
1521
__all__ = (
1622
"get_stats",
1723
"get_roster",
@@ -20,7 +26,6 @@
2026
"MetsCommand",
2127
"MetsCommandModel",
2228
)
23-
log = logging.getLogger(__name__)
2429

2530

2631
def get_stats():

0 commit comments

Comments
 (0)