2023-01-09 18:38:08 -05:00
|
|
|
use poise::serenity_prelude as serenity;
|
|
|
|
|
2023-01-27 14:26:58 -05:00
|
|
|
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 {
|
2023-01-31 22:15:31 -05:00
|
|
|
commands: vec![
|
2023-03-08 13:25:50 -05:00
|
|
|
commands::ping::ping(),
|
2023-01-31 22:15:31 -05:00
|
|
|
commands::team::team(),
|
|
|
|
commands::random::random(),
|
2023-02-07 17:49:48 -05:00
|
|
|
commands::register::register(),
|
2023-03-08 13:25:50 -05:00
|
|
|
commands::profile::profile(),
|
2023-03-14 13:48:35 -04:00
|
|
|
commands::pog::pog(),
|
2023-01-31 22:15:31 -05:00
|
|
|
], // 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 {
|
2023-02-07 17:49:48 -05:00
|
|
|
poise::builtins::register_globally(ctx, &framework.options().commands).await?; // Update slash commands
|
2023-01-27 14:26:58 -05:00
|
|
|
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
|
|
|
}
|