Skip to content
Snippets Groups Projects
main.rs 657 B
Newer Older
Stephen D's avatar
Stephen D committed
#[macro_use]
extern crate diesel;
Stephen D's avatar
Stephen D committed

Stephen D's avatar
Stephen D committed
mod config;
mod framebuffer;
Stephen D's avatar
Stephen D committed
mod handlers;
Stephen D's avatar
Stephen D committed
mod joker;
Stephen D's avatar
Stephen D committed
mod models;
mod program;
mod schema;

Stephen D's avatar
Stephen D committed
use crate::handlers::Dispatcher;
Stephen D's avatar
Stephen D committed

use serenity::prelude::GatewayIntents;
Stephen D's avatar
Stephen D committed
use serenity::Client;
Stephen D's avatar
Stephen D committed

#[tokio::main]
async fn main() {
	let config = config::get_conf();
	let token = config.token;

Stephen D's avatar
Stephen D committed
	let mut client = Client::builder(
		&token,
		GatewayIntents::GUILD_MESSAGES
			.union(GatewayIntents::GUILD_MESSAGE_REACTIONS)
			.union(GatewayIntents::MESSAGE_CONTENT),
	)
	.event_handler(Dispatcher::default())
	.await
	.expect("Error creating client");
Stephen D's avatar
Stephen D committed
	if let Err(e) = client.start().await {
		eprintln!("Client error: {}", e);
Stephen D's avatar
Stephen D committed
	}
}