This repository was archived by the owner on Jun 27, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ To see a list of attributes, use `~help`:
3333
3434## System Requirements
3535
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.
3837
3938## IRC Bot Setup
4039
Original file line number Diff line number Diff line change 11# Playbot's (default) configuration file
22
3+ # bitly-key = "..."
4+
35[[server ]]
46nicks = [" playbot-rs" , " playbot-rs-mini" ]
57# password = "1234"
Original file line number Diff line number Diff line change @@ -42,15 +42,6 @@ fn get_rust_versions() -> Vec<String> {
4242 versions
4343}
4444
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-
5445struct Playbot {
5546 conn : IrcServer ,
5647 rust_versions : Vec < String > ,
@@ -215,15 +206,13 @@ fn main() {{
215206fn main ( ) {
216207 env_logger:: init ( ) . unwrap ( ) ;
217208
218- fs:: metadata ( "whitelist" ) . expect ( "syscall whitelist file not found" ) ;
219-
220- let bitly_key = read_bitly_token ( ) ;
221209 let rust_versions = get_rust_versions ( ) ;
222210
223211 // FIXME All these unwraps are pretty bad UX, but they should only panic on misconfiguration
224212 let mut config = String :: new ( ) ;
225213 File :: open ( "playbot.toml" ) . unwrap ( ) . read_to_string ( & mut config) . unwrap ( ) ;
226214 let toml = toml:: Parser :: new ( & config) . parse ( ) . unwrap ( ) ;
215+ let bitly_key = toml[ "bitly-key" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
227216
228217 let mut threads = Vec :: new ( ) ;
229218 for server in toml[ "server" ] . as_slice ( ) . unwrap ( ) {
You can’t perform that action at this time.
0 commit comments