From 08cd434e84c20467da09ab107092e7f89fb3a6f4 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:22:45 -0500 Subject: [PATCH] Require bot prefix env var --- README.md | 2 ++ src/core/botinstance.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a3c0c5..ce97dbe 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,5 @@ test ModulatingForceBot `access_token = ` `bot_channels = ,` + +`prefix = ` \ No newline at end of file diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index f7f4f15..862fb4e 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -53,6 +53,7 @@ impl BotInstance { // let login_name = "modulatingforcebot".to_owned(); let login_name = env::var("login_name").unwrap().to_owned(); let oauth_token = env::var("access_token").unwrap().to_owned(); + let prefix = env::var("prefix").unwrap().to_owned().chars().next().expect("ERROR : when defining prefix"); /* Vector of channels to join @@ -81,7 +82,8 @@ impl BotInstance { let mut b = BotInstance { - prefix : '>', + //prefix : '>', + prefix : prefix, bot_channel : login_name , // tclient : TwitchClient { incoming_messages , client }, incoming_messages : incoming_messages,