From cf6d3b2e55ff1af112301212e8864923db0fd876 Mon Sep 17 00:00:00 2001 From: Tavi <66774833+totallytavi@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:07:00 -0600 Subject: [PATCH 1/2] feat: allow threads for setup command --- commands/guild.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands/guild.js b/commands/guild.js index 428dc71..3a99ab8 100644 --- a/commands/guild.js +++ b/commands/guild.js @@ -1,4 +1,5 @@ const ParticipatingServer = require('../database/models/ParticipatingServer'); +const { ChannelType } = require('discord.js'); // check if server has feature enabled. async function checkFeature(serverID) { @@ -31,7 +32,11 @@ module.exports.data = new CmdBuilder() .addChannelOption((option) => option .setName('channel') .setDescription('Provide a channel you want Agent Black to report to.') - .addChannelType(0) + .addChannelType( + ChannelType.GuildText, + ChannelType.PrivateThread, + ChannelType.PublicThread + ) .setRequired(true)) .addRoleOption((option) => option .setName('role') From f1a7a72b3f48c859c98e48d53ccfb79b91dc41bf Mon Sep 17 00:00:00 2001 From: Tavi <66774833+totallytavi@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:12:50 -0600 Subject: [PATCH 2/2] feat: refactor guildmgr setup to account for threads * Allow threads to be selected by maintainers * Add note in channel name if channel is a thread --- functions/AUTOCOMPLETE/RESOLVE/channel.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/functions/AUTOCOMPLETE/RESOLVE/channel.js b/functions/AUTOCOMPLETE/RESOLVE/channel.js index 37353d4..b258379 100644 --- a/functions/AUTOCOMPLETE/RESOLVE/channel.js +++ b/functions/AUTOCOMPLETE/RESOLVE/channel.js @@ -2,6 +2,11 @@ This function provides a autocomplete for channels in another server. This is needed, as discords built in search only searches the server where the command is executed in */ +const VALID_TYPES = [ + ChannelType.GuildText, + ChannelType.PrivateThread, + ChannelType.PublicThread +]; module.exports.run = async (searchInput, guildId) => { // if (searchInput.length <= 2) return []; @@ -10,7 +15,14 @@ module.exports.run = async (searchInput, guildId) => { if (!guild) return [{ name: 'Define server first.', value: '0' }]; const channels = guild.channels.cache - .filter((channel) => channel.type === 'GUILD_TEXT'); + .filter((channel) => VALID_TYPES.includes(channel.type)) + .map((channel) => { + if (channel.type !== ChannelType.GuildText) { + // Notify maintainers this is a thread + channel.name += channel.Name + ` (Thread in ${channel.parent.name || "???"})` + } + return channel; + }); // id search if (searchInput !== '' && !isNaN(searchInput)) {