chore: make pledges about how this bot works

This commit is contained in:
2026-04-13 21:19:54 -04:00
parent dfda319ab4
commit 666d13f25b

View File

@@ -2,8 +2,8 @@ use crate::{VCs, command::State};
use async_trait::async_trait;
use snafu::{OptionExt, Snafu};
use songbird::{CoreEvent, Event, EventContext, EventHandler};
use time::UtcDateTime;
use std::{sync::LazyLock, time::Instant};
use time::UtcDateTime;
use twilight_model::{
application::{
command::{Command, CommandType},
@@ -17,7 +17,9 @@ use twilight_model::{
},
};
use twilight_util::builder::{
InteractionResponseDataBuilder, command::CommandBuilder, embed::EmbedBuilder,
InteractionResponseDataBuilder,
command::CommandBuilder,
embed::{EmbedBuilder, EmbedFieldBuilder},
};
const NAME: &str = "join";
@@ -82,7 +84,6 @@ fn get_guild_and_vc_error_to_embed(error: GetGuildAndVoiceChannelIdError) -> Emb
}
}
#[derive(Debug, Clone)]
struct Handler {
start_instant: Instant,
@@ -176,21 +177,39 @@ pub async fn handle(state: State, interaction: Interaction) {
let start_instant = Instant::now();
let start_utc = UtcDateTime::now();
let handler = Handler { start_instant, start_utc };
call.lock().await.add_global_event(
CoreEvent::RtpPacket.into(),
handler,
);
let handler = Handler {
start_instant,
start_utc,
};
call.lock()
.await
.add_global_event(CoreEvent::RtpPacket.into(), handler);
let channel_mention = format!("<#{voice_channel_id}>");
let bot_owner_mention = format!("<@{}>", state.discord_bot_owner_user_id);
state
.discord_client
.interaction(state.discord_application_id)
.update_response(
&interaction.token,
).embeds(Some(&[
EmbedBuilder::new().title("Joined VC with intent to record").description(format!("This bot joined {channel_mention} and intends to start recording after a responsible disclosure and consent.")).validate().unwrap().build()
EmbedBuilder::new()
.title("Joined VC to record")
.description(format!("This bot joined {channel_mention} and intends to record. Here are some pledges backed by faith (because there is no way to verify them yourself) in {bot_owner_mention}:"))
.field(
EmbedFieldBuilder::new("Recordings are never shared", "Audio recordings are only stored on my home server and desktop computer and will never be uploaded to services or hardware that is owned by another person: not even curated clips, and not even to people who were in the recording. When transcription to text is implemented, this will only be run on my personally owned devices and not on any internet or cloud offering.").build()
)
.field(
EmbedFieldBuilder::new("You won't be \"audited\"", "I will not reference things said in past recordings with the goal of \"making a point\", nor pull them up on the spot (even by the request of the person who said it). Ideally, these are just peace of mind for me that I'm not missing out by not being in a Discord call all the time and can take my life back, so using them in an unhealthy way isn't in my interest.").build()
)
.field(
EmbedFieldBuilder::new("Code is publically available", "The latest source code is at https://gitea.katniss.top/jacob/fomo-reducer (so that I don't have to write guarantees about the technology here and you can just check it yourself)").build()
)
.validate()
.unwrap()
.build()
]))
.await
.expect("TODO");