@@ -19,7 +19,7 @@ Archive bot needs a bit of data to get started:
19
19
- Configure how small a channel has to be before it's considered "small."
20
20
21
21
``` rust
22
- let config = archive_bot :: Config {
22
+ let bot = ArchiveBot {
23
23
// Bot tokens look like: xoxb-xxxxxxxyourtokenxxxxxxx.
24
24
token : env :: var (" SLACK_BOT_TOKEN" ). expect (" Error: environment variable SLACK_BOT_TOKEN is not set." ),
25
25
// Use the channel ID and not the name.
@@ -32,7 +32,7 @@ let config = archive_bot::Config {
32
32
" Hey boss, take a look at these, will ya?" ,
33
33
],
34
34
// How long before a channel is stale (in seconds).
35
- stale_after : 2 * 7 * 24 * 60 * 60 ,
35
+ stale_after : 6 * 7 * 24 * 60 * 60 ,
36
36
// How small a "small" channel is.
37
37
small_channel_threshold : 3 ,
38
38
// Whether to send a secondary notification to a different channel (message only).
@@ -44,17 +44,17 @@ let config = archive_bot::Config {
44
44
" Hey folks! I, uh... made a list for you. Of channels. That you should archive. Maybe." ,
45
45
" Hey everyone! If you want the satisfaction of crossing a task off your list, I have one!" ,
46
46
],
47
- .. archive_bot :: Config :: default ()
47
+ .. ArchiveBot :: default ()
48
48
};
49
49
```
50
50
51
51
Or, using default values:
52
52
53
53
``` rust
54
- let config = archive_bot :: Config {
54
+ let bot = ArchiveBot {
55
55
token : env :: var (" SLACK_BOT_TOKEN" ). expect (" Error: environment variable SLACK_BOT_TOKEN is not set." ),
56
56
notification_channel_id : " C01A02A03A04" . to_string (),
57
- .. archive_bot :: Config :: default ()
57
+ .. ArchiveBot :: default ()
58
58
};
59
59
```
60
60
@@ -64,7 +64,7 @@ Currently this bot consists of a single runtime, with a single action. Further a
64
64
config options TBD.
65
65
66
66
``` rust
67
- match archive_bot :: run (& config ). await {
67
+ match bot . run (). await {
68
68
Ok (_ ) => println! (" Success!" ),
69
69
Err (e ) => panic! (" Uhoh! {:}" , e ),
70
70
}
0 commit comments