From 4da708874a9ad1c8f7d83967a53eaecfdd0e845c Mon Sep 17 00:00:00 2001 From: KTrain5369 <69028025+KTrain5169@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:11:45 +1000 Subject: [PATCH] add autoresponse & tag for dm/vc support Co-Authored-By: maskers <97827489+maskersss@users.noreply.github.com> Co-Authored-By: Samalando <156577273+Samalando@users.noreply.github.com> --- src/handlers/event/dms_vcs.rs | 28 ++++++++++++++++++++++++++++ tags/dm.md | 12 ++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/handlers/event/dms_vcs.rs create mode 100644 tags/dm.md diff --git a/src/handlers/event/dms_vcs.rs b/src/handlers/event/dms_vcs.rs new file mode 100644 index 00000000..110d6d05 --- /dev/null +++ b/src/handlers/event/dms_vcs.rs @@ -0,0 +1,28 @@ +use std::{sync::OnceLock, time::SystemTime}; + +use eyre::Result; +use log::trace; +use poise::serenity_prelude::{Context, Message}; +use regex::Regex; + +fn regex() -> &'static Regex { + static REGEX: OnceLock = OnceLock::new(); + REGEX.get_or_init(|| Regex::new(r"(?i)\b(?:dms|dm|vc|vcs|voice call|screenshare)\b").unwrap()) +} + +const MESSAGE: &str = "Please try to keep all support conversations here, run `/tag dm` to learn more."; + +pub async fn handle(ctx: &Context, message: &Message) -> Result<()> { + if !regex().is_match(&message.content) { + trace!( + "The message '{}' (probably) doesn't say DMs, VCs", + message.content + ); + return Ok(()); + } + + let response = format!(MESSAGE); + message.reply(ctx, &response).await?; + + Ok(()) +} diff --git a/tags/dm.md b/tags/dm.md new file mode 100644 index 00000000..cd234c61 --- /dev/null +++ b/tags/dm.md @@ -0,0 +1,12 @@ +--- +title: Do not ask for Prism Launcher support in direct/voice chats! +color: red +--- + +We do not recommend support in DMs or VCs. This is because: + +- You are forcing the person to commit to helping you. Everyone that helps out in support channels is a volunteer and isn't obligated to help you. +- The person trying to help you may give a bad answer, whether due to lack of knowledge, language barriers or out of malice, and they cannot be easily corrected by others. +- You are slowing down your response time by banking on one person to be available rather than asking in a forum where there will usually be someone with expertise. +- Most people who actively help others here will redirect you to the support forum anyways. You might as well save your and their time by asking in the proper space. +- VCs require people to reveal their voice. Not everyone is comfortable with this and it's often harder to resolve via VC anyways.