From 529e27ea2f624d4879fff52e369a97bc1b5d0c53 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 22 Aug 2023 20:20:46 +0200 Subject: [PATCH] gobot:: Discord bot token set via env variable --- rogueviz/gobot.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rogueviz/gobot.cpp b/rogueviz/gobot.cpp index dcd61d8f..99508498 100644 --- a/rogueviz/gobot.cpp +++ b/rogueviz/gobot.cpp @@ -748,8 +748,10 @@ void go_discord() { #if AEGIS bot_thread = std::thread([] { println(hlog, "starting bot"); + char *token = getenv("GOBOT_TOKEN"); + if(!token) throw hr_exception("set the env variable GOBOT_TOKEN to the Discord bot token to run gobot"); uint64_t intents = dpp::i_default_intents | dpp::i_message_content; - dpp::cluster bot(AEGIS_TOKEN, intents); + dpp::cluster bot(token, intents); pbot = ⊥ std::mutex lock; println(hlog, "on_message_create");