Skip to content

Commit

Permalink
Adjust help thread max age, allow replies in promotion threads (#421)
Browse files Browse the repository at this point in the history
* Up idle timeout for help threads to 72 hours

* Don’t prevent replies in promotion channels

Resolves #418
  • Loading branch information
vcarl authored Oct 21, 2024
1 parent 258fe83 commit 3192f94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/features/autothread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
15 changes: 1 addition & 14 deletions src/features/promotion-threads.ts
Original file line number Diff line number Diff line change
@@ -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 }) => {
Expand All @@ -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,
Expand Down

0 comments on commit 3192f94

Please sign in to comment.