Commit 6c8335ed authored by Timothy du Heaume's avatar Timothy du Heaume

load discord_token at runtime

parent 9664d0e1
...@@ -11,8 +11,6 @@ lazy_static! { ...@@ -11,8 +11,6 @@ lazy_static! {
pub static ref CONFIG: UccbotConfig = toml::from_str(&CONFIG_FILE).unwrap(); pub static ref CONFIG: UccbotConfig = toml::from_str(&CONFIG_FILE).unwrap();
} }
pub static DISCORD_TOKEN: &str = include_str!("discord_token");
#[derive(Deserialize)] #[derive(Deserialize)]
pub struct UccbotConfig { pub struct UccbotConfig {
pub server_id: u64, pub server_id: u64,
......
...@@ -5,7 +5,7 @@ extern crate lazy_static; ...@@ -5,7 +5,7 @@ extern crate lazy_static;
extern crate log; extern crate log;
extern crate simplelog; extern crate simplelog;
use simplelog::*; use simplelog::*;
use std::fs::File; use std::fs::{File, read_to_string};
use serenity::{ use serenity::{
model::{channel, channel::Message, gateway::Ready, guild::Member}, model::{channel, channel::Message, gateway::Ready, guild::Member},
...@@ -155,7 +155,7 @@ fn main() { ...@@ -155,7 +155,7 @@ fn main() {
// Configure the client with your Discord bot token in the environment. // Configure the client with your Discord bot token in the environment.
let token = config::DISCORD_TOKEN; let token = read_to_string("discord_token").unwrap();
// Create a new instance of the Client, logging in as a bot. This will // 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 // automatically prepend your bot token with "Bot ", which is a requirement
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment