echbot/src/main.rs

35 lines
1.2 KiB
Rust
Raw Normal View History

2023-01-09 18:38:08 -05:00
use poise::serenity_prelude as serenity;
mod commands;
2023-01-31 19:25:10 -05:00
pub struct Data {}
2023-01-09 18:38:08 -05:00
type Error = Box<dyn std::error::Error + Send + Sync>;
type Context<'a> = poise::Context<'a, Data, Error>;
#[tokio::main]
async fn main() {
let framework = poise::Framework::builder()
.options(poise::FrameworkOptions {
commands: vec![
commands::ping::ping(),
commands::team::team(),
commands::random::random(),
commands::register::register(),
commands::profile::profile(),
2023-03-14 13:48:35 -04:00
commands::pog::pog(),
], // IntelliJ doesn't like this, but it's fine.
2023-01-09 18:38:08 -05:00
..Default::default()
})
2023-01-21 19:49:39 -05:00
.token(std::env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN"))
2023-01-11 16:31:15 -05:00
.intents(serenity::GatewayIntents::non_privileged()) // Set intents for Discord dev portal
2023-01-09 18:38:08 -05:00
.setup(|ctx, _ready, framework| {
Box::pin(async move {
poise::builtins::register_globally(ctx, &framework.options().commands).await?; // Update slash commands
ctx.set_activity(serenity::Activity::playing("SMITE")).await;
2023-01-09 18:38:08 -05:00
Ok(Data {})
})
});
framework.run().await.unwrap();
2023-01-09 18:41:05 -05:00
}