This commit is contained in:
blackbeard420 2023-12-28 18:44:19 -05:00
parent 677f5aede7
commit 2cf3c9216b
Signed by: blackbeard420
GPG Key ID: 88C719E09CDDA4A5
3 changed files with 14 additions and 2 deletions

11
Cargo.lock generated
View File

@ -328,6 +328,16 @@ dependencies = [
"slab",
]
[[package]]
name = "gethostname"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818"
dependencies = [
"libc",
"windows-targets 0.48.5",
]
[[package]]
name = "gimli"
version = "0.28.1"
@ -415,6 +425,7 @@ version = "0.1.0"
dependencies = [
"failure",
"futures",
"gethostname",
"irc",
"tokio",
]

View File

@ -9,4 +9,5 @@ edition = "2021"
irc = "0.15.0"
tokio = { version = "1.0.0", features = ["rt", "rt-multi-thread", "macros", "net", "time"] }
futures = "0.3.0"
failure = "0.1.8"
failure = "0.1.8"
gethostname = "*"

View File

@ -7,7 +7,7 @@ use std::process;
async fn main() -> Result<(), failure::Error> {
// We can also load the Config at runtime via Config::load("path/to/config.toml")
let config = Config {
nickname: Some("irc-rpc".to_owned()),
nickname: Some(gethostname::gethostname().to_str().unwrap().to_owned()),
server: Some("irc.ouch.chat".to_owned()),
channels: vec!["#testing".to_owned()],
..Config::default()