Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add autoresponse & tag for dm/vc support #397

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/handlers/event/dms_vcs.rs
Original file line number Diff line number Diff line change
@@ -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<Regex> = 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(())
}
12 changes: 12 additions & 0 deletions tags/dm.md
Original file line number Diff line number Diff line change
@@ -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.
Loading