use crate::{
    Data, Error
};
use poise::serenity_prelude as sere;

pub async fn event_handler(
    ctx: &sere::Context,
    event: &sere::FullEvent,
    _framework: poise::FrameworkContext<'_, Data, Error>,
    user_data: &Data,
) -> Result<(), Error> {
    match event {
        sere::FullEvent::GuildMemberAddition { new_member } => { 
            crate::events::user_join::user_join(ctx, new_member, &user_data.pool).await;
        }
        _ => {}
    }
    Ok(())
}