From 2e07297600e7d104fe99d4c437e222c15cea3d5f Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Tue, 28 Nov 2023 01:49:51 -0500 Subject: [PATCH] `access_token` is defined in env variable --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 2 +- README.md | 8 +++++++- flake.nix | 4 ++-- src/main.rs | 9 +++++---- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 03956aa..5f3341c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,15 +107,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" -[[package]] -name = "daphbot" -version = "0.1.0" -dependencies = [ - "dotenv", - "tokio", - "twitch-irc", -] - [[package]] name = "dotenv" version = "0.15.0" @@ -156,6 +147,15 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "forcebot_rs" +version = "0.1.0" +dependencies = [ + "dotenv", + "tokio", + "twitch-irc", +] + [[package]] name = "foreign-types" version = "0.3.2" diff --git a/Cargo.toml b/Cargo.toml index 9013807..84da1b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "daphbot" +name = "forcebot_rs" version = "0.1.0" edition = "2021" diff --git a/README.md b/README.md index 91c1af8..ddd1aeb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ # Forcebot -test ModulatingForceBot \ No newline at end of file +test ModulatingForceBot + +## Usage + +Set the following environment variables + +`access_token = ` \ No newline at end of file diff --git a/flake.nix b/flake.nix index 0493a4d..8e6171d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "daphbot flake"; + description = "forcebot_rs flake"; inputs = { nixpkgs = { @@ -13,7 +13,7 @@ }; in { devShells.${system}.default = pkgs.mkShell { - name = "daphbot-devenv"; + name = "forcebot_rs-devenv"; buildInputs = with pkgs; [ openssl pkg-config diff --git a/src/main.rs b/src/main.rs index b6f14da..afaa9e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,11 +2,12 @@ use twitch_irc::login::StaticLoginCredentials; use twitch_irc::ClientConfig; use twitch_irc::SecureTCPTransport; use twitch_irc::TwitchIRCClient; +use std::env; #[tokio::main] pub async fn main() { - let login_name = "daphbot".to_owned(); - let oauth_token = "".to_owned(); + let login_name = "modulatingforcebot".to_owned(); + let oauth_token = env::var("access_token").unwrap().to_owned(); let config = ClientConfig::new_simple( StaticLoginCredentials::new(login_name, Some(oauth_token)) @@ -20,8 +21,8 @@ pub async fn main() { } }); - client.join("daph".to_owned()).unwrap(); - client.say("daph".to_owned(), "Connected!".to_owned()).await.unwrap(); + client.join("modulatingforcebot".to_owned()).unwrap(); + client.say("modulatingforcebot".to_owned(), "Connected!".to_owned()).await.unwrap(); join_handle.await.unwrap(); } \ No newline at end of file