From 3192f94575c261e10937378143e3998b26fadb49 Mon Sep 17 00:00:00 2001 From: Carl Vitullo Date: Mon, 21 Oct 2024 10:21:46 -0600 Subject: [PATCH] Adjust help thread max age, allow replies in promotion threads (#421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Up idle timeout for help threads to 72 hours * Don’t prevent replies in promotion channels Resolves #418 --- src/features/autothread.ts | 2 +- src/features/promotion-threads.ts | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/features/autothread.ts b/src/features/autothread.ts index 3f2e2ea5..ca2f2cbd 100644 --- a/src/features/autothread.ts +++ b/src/features/autothread.ts @@ -13,7 +13,7 @@ import { threadStats } from "../features/stats"; import { createNewThreadName } from "../helpers/threads"; const CHECKS = ["☑️", "✔️", "✅"]; -const IDLE_TIMEOUT = 36; +const IDLE_TIMEOUT = 72; const STAFF_ACCEPT_THRESHOLD = 2; const autoThread: ChannelHandlers = { diff --git a/src/features/promotion-threads.ts b/src/features/promotion-threads.ts index 7e3b253c..7a2700c8 100644 --- a/src/features/promotion-threads.ts +++ b/src/features/promotion-threads.ts @@ -1,10 +1,9 @@ import ogs from "open-graph-scraper"; -import { sleep } from "../helpers/misc"; import { ChannelHandlers } from "../types"; import { threadStats } from "../features/stats"; import { format } from "date-fns"; import fetch from "node-fetch"; -import { ChannelType, MessageType } from "discord.js"; +import { ChannelType } from "discord.js"; const promotionThread: ChannelHandlers = { handleMessage: async ({ msg }) => { @@ -15,18 +14,6 @@ const promotionThread: ChannelHandlers = { return; } - // Delete top-level replies - if (msg.type === MessageType.Reply) { - msg.author.send(msg.content); - const reply = await msg.reply( - "This is a thread-only channel! Please reply in that message’s thread. Your message has been DM’d to you.", - ); - msg.delete(); - threadStats.threadReplyRemoved(msg.channelId); - sleep(5).then(() => reply.delete()); - return; - } - const [firstLink] = msg.content.match( /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g,