async fn add_delete_vote(ctx: &Context, voter: User, message: &mut Message) {
    let db = ctx.get_db().await;
    let event = db.get_voting_event(message.id.0).await.unwrap();
    if event.delete_votes == event.delete_votes_required {
        return;
    }
    if db
        .add_vote(event.vote_message_id, voter.id.0, 0)
        .await
        .unwrap()
        == 0
    {
        return;
    }
    let event = db.get_voting_event(message.id.0).await.unwrap();
    if event.delete_votes == event.delete_votes_required {
        let message = ctx
            .http
            .get_message(
                event.suspect_message_channel_id as u64,
                event.suspect_message_id as u64,
            )
            .await
            .unwrap();
        message.delete(&ctx.http).await.unwrap();
        db.message_deleted(chrono::Local::now().naive_local(), event.vote_message_id)
            .await
            .unwrap();
    }
    update_voting_message(ctx, event.vote_message_id as u64).await;
}
/// The function to handle a vote-addition event for the "delete_button"
/// This function adds the vote then checks whether the goal is reached
/// and then acts accordingly, either by deleting the message and then updating
/// the announcement on the moderation channel or just by updating the announcement
The function to handle a vote-addition event for the "delete_button"
This function adds the vote then checks whether the goal is reached
and then acts accordingly, either by deleting the message and then updating
the announcement on the moderation channel or just by updating the announcement
The function to handle a vote - addition event for the " delete_button " This function adds the vote then checks whether the goal is reached and then acts accordingly either by deleting the message and then updating the announcement on the moderation channel or just by updating the announcement
async fn add_delete_vote(ctx: &Context, voter: User, message: &mut Message) {
    let db = ctx.get_db().await;
    let event = db.get_voting_event(message.id.0).await.unwrap();
    if event.delete_votes == event.delete_votes_required {
        return;
    }
    if db
        .add_vote(event.vote_message_id, voter.id.0, 0)
        .await
        .unwrap()
        == 0
    {
        return;
    }
    let event = db.get_voting_event(message.id.0).await.unwrap();
    if event.delete_votes == event.delete_votes_required {
        let message = ctx
            .http
            .get_message(
                event.suspect_message_channel_id as u64,
                event.suspect_message_id as u64,
            )
            .await
            .unwrap();
        message.delete(&ctx.http).await.unwrap();
        db.message_deleted(chrono::Local::now().naive_local(), event.vote_message_id)
            .await
            .unwrap();
    }
    update_voting_message(ctx, event.vote_message_id as u64).await;
}
async fn add_delete_vote ( ctx : & Context , voter : User , message : & mut Message ) { let db = ctx . get_db ( ) . await ; let event = db . get_voting_event ( message . id . 0 ) . await . unwrap ( ) ; if event . delete_votes == event . delete_votes_required { return ; } if db . add_vote ( event . vote_message_id , voter . id . 0 , 0 ) . await . unwrap ( ) == 0 { return ; } let event = db . get_voting_event ( message . id . 0 ) . await . unwrap ( ) ; if event . delete_votes == event . delete_votes_required { let message = ctx . http . get_message ( event . suspect_message_channel_id as u64 , event . suspect_message_id as u64 , ) . await . unwrap ( ) ; message . delete ( & ctx . http ) . await . unwrap ( ) ; db . message_deleted ( chrono :: Local :: now ( ) . naive_local ( ) , event . vote_message_id ) . await . unwrap ( ) ; } update_voting_message ( ctx , event . vote_message_id as u64 ) . await ; }
The function to handle a vote-addition event for the "delete_button"
This function adds the vote then checks whether the goal is reached
and then acts accordingly, either by deleting the message and then updating
the announcement on the moderation channel or just by updating the announcement
The function to handle a vote - addition event for the " delete_button " This function adds the vote then checks whether the goal is reached and then acts accordingly either by deleting the message and then updating the announcement on the moderation channel or just by updating the announcement
ctx
&Context
voter
User
message
&mut Message
ctx
&Context
voter
User
message
&mut Message