# aoc_leaderbot_slack_lib
[](https://github.com/clechasseur/aoc_leaderbot/actions/workflows/ci.yml) [](https://codecov.io/gh/clechasseur/aoc_leaderbot) [](https://github.com/clechasseur/aoc_leaderbot/actions/workflows/audit-check.yml) [](https://crates.io/crates/aoc_leaderbot_slack_lib) [](https://github.com/clechasseur/aoc_leaderbot/tree/main/aoc_leaderbot_slack_lib) [](https://crates.io/crates/aoc_leaderbot_slack_lib) [](https://docs.rs/aoc_leaderbot_slack_lib) [](../CODE_OF_CONDUCT.md)
Library implementing Slack-specific helpers for [`aoc_leaderbot`](https://github.com/clechasseur/aoc_leaderbot), a bot that can watch an [Advent of Code](https://adventofcode.com/) private leaderboard for changes and report them to various channels like Slack.
## Installing
Add `aoc_leaderbot_slack_lib` to your dependencies:
```toml
[dependencies]
aoc_leaderbot_slack_lib = "2.0.0"
```
or by running:
```shell
cargo add aoc_leaderbot_slack_lib
```
## Trait implementations
This library includes implementations of the traits found in [`aoc_leaderbot_lib`](https://crates.io/crates/aoc_leaderbot_lib).
### [`SlackWebhookReporter`](https://docs.rs/aoc_leaderbot_slack_lib/latest/aoc_leaderbot_slack_lib/leaderbot/reporter/slack/webhook/struct.SlackWebhookReporter.html)
Required feature: `reporter-webhook` (enabled by default)
An implementation of the [`Reporter`](https://docs.rs/aoc_leaderbot_lib/latest/aoc_leaderbot_lib/leaderbot/trait.Reporter.html) trait that reports changes to the leaderboard to a Slack channel via a [Slack webhook](https://api.slack.com/messaging/webhooks).
The reporter has several configurable input properties.
Although most have default values, at least two must be specified explicitly:
* [`webhook_url`](https://docs.rs/aoc_leaderbot_slack_lib/latest/aoc_leaderbot_slack_lib/leaderbot/reporter/slack/webhook/struct.SlackWebhookReporterBuilder.html#method.webhook_url): URL of the Slack webhook to use to report changes.
* [`channel`](https://docs.rs/aoc_leaderbot_slack_lib/latest/aoc_leaderbot_slack_lib/leaderbot/reporter/slack/webhook/struct.SlackWebhookReporterBuilder.html#method.channel): Slack channel where to post message reporting changes.
There are other optional properties that can be specified.
The easiest way to create a reporter instance would be via the [`builder`](https://docs.rs/aoc_leaderbot_slack_lib/latest/aoc_leaderbot_slack_lib/leaderbot/reporter/slack/webhook/struct.SlackWebhookReporter.html#method.builder).
Many properties will also default to reading their values from environment variables (see each property's documentation for details).
## Minimum Rust version
`aoc_leaderbot_slack_lib` currently builds on Rust 1.88 or newer.
## Contributing / Local development
For information about contributing to this project, see [CONTRIBUTING](../CONTRIBUTING.md).
For information regarding local development, see [DEVELOPMENT](../DEVELOPMENT.md).