This repository was archived by the owner on Jun 27, 2018. It is now read-only.
File tree 3 files changed +4
-14
lines changed
3 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ To see a list of attributes, use `~help`:
33
33
34
34
## System Requirements
35
35
36
- Rust-Playpen currently needs to be run on an Arch Linux system that meets
37
- [ playpen's requirements] [ playpen ] .
36
+ Rust-Playpen currently needs to be run on a system with access to Docker.
38
37
39
38
## IRC Bot Setup
40
39
Original file line number Diff line number Diff line change 1
1
# Playbot's (default) configuration file
2
2
3
+ #bitly-key = "..."
4
+
3
5
[[server]]
4
6
nicks = ["playbot-rs", "playbot-rs-mini"]
5
7
#password = "1234"
Original file line number Diff line number Diff line change @@ -42,15 +42,6 @@ fn get_rust_versions() -> Vec<String> {
42
42
versions
43
43
}
44
44
45
- fn read_bitly_token ( ) -> String {
46
- // Read the bitly API token
47
- let mut key = String :: new ( ) ;
48
- File :: open ( "bitly_key" ) . unwrap ( ) . read_to_string ( & mut key) . unwrap ( ) ;
49
- // Allow trailing newline
50
- let key = String :: from ( key. lines ( ) . next ( ) . unwrap ( ) ) ;
51
- key
52
- }
53
-
54
45
struct Playbot {
55
46
conn : IrcServer ,
56
47
rust_versions : Vec < String > ,
@@ -215,15 +206,13 @@ fn main() {{
215
206
fn main ( ) {
216
207
env_logger:: init ( ) . unwrap ( ) ;
217
208
218
- fs:: metadata ( "whitelist" ) . expect ( "syscall whitelist file not found" ) ;
219
-
220
- let bitly_key = read_bitly_token ( ) ;
221
209
let rust_versions = get_rust_versions ( ) ;
222
210
223
211
// FIXME All these unwraps are pretty bad UX, but they should only panic on misconfiguration
224
212
let mut config = String :: new ( ) ;
225
213
File :: open ( "playbot.toml" ) . unwrap ( ) . read_to_string ( & mut config) . unwrap ( ) ;
226
214
let toml = toml:: Parser :: new ( & config) . parse ( ) . unwrap ( ) ;
215
+ let bitly_key = toml[ "bitly-key" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
227
216
228
217
let mut threads = Vec :: new ( ) ;
229
218
for server in toml[ "server" ] . as_slice ( ) . unwrap ( ) {
You can’t perform that action at this time.
0 commit comments