1 2 3 4 5 6 7 8 9 10
use serenity::prelude::Context; use serenity::model::gateway::{Ready, Game}; use std::env; pub fn on_message(ctx: &Context, _: &Ready) { match env::var("BOT_GAME") { Ok(val) => ctx.set_game(Game::playing(&val)), Err(_) => return }; }