From 8168602120670a2416a1c5f927d815f5f7d0f84b Mon Sep 17 00:00:00 2001 From: Tom Almeida <tommoa256@gmail.com> Date: Sat, 10 Aug 2019 19:46:40 +0800 Subject: [PATCH] Make the discord token a static variable --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e8debb8..a4eea69 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,8 @@ use rand::Rng; struct Handler; +static DISCORD_TOKEN: &str = include_str!("discord_token"); + static SERVER_ID: u64 = 606351521117896704; // #general static MAIN_CHANNEL: serenity::model::id::ChannelId = @@ -290,7 +292,7 @@ impl EventHandler for Handler { fn main() { // Configure the client with your Discord bot token in the environment. - let token = include_str!("discord_token"); + let token = DISCORD_TOKEN; // Create a new instance of the Client, logging in as a bot. This will // automatically prepend your bot token with "Bot ", which is a requirement -- GitLab