diff --git a/backend/package-lock.json b/backend/package-lock.json index 3c496965..461ff917 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -14,7 +14,7 @@ "cors": "^2.8.5", "cross-env": "^5.2.0", "deep-diff": "^1.0.2", - "discord.js": "^13.0.0-dev.ab0b3b9.1625400166", + "discord.js": "^13.0.0-dev.a7c6678.1625427504", "dotenv": "^4.0.0", "emoji-regex": "^8.0.0", "erlpack": "github:discord/erlpack", @@ -81,9 +81,8 @@ "version": "30.0.0-beta.38", "license": "MIT", "dependencies": { - "@discordjs/voice": "^0.5.1", "discord-api-types": "^0.18.1", - "discord.js": "^13.0.0-dev.ab0b3b9.1625400166", + "discord.js": "^13.0.0-dev.a7c6678.1625427504", "knub-command-manager": "^9.1.0", "ts-essentials": "^6.0.7" }, @@ -2160,9 +2159,9 @@ } }, "node_modules/discord.js": { - "version": "13.0.0-dev.ab0b3b9.1625400166", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.ab0b3b9.1625400166.tgz", - "integrity": "sha512-nTdUyPEvy1OxCoSXVJrJDFMxEIEUr/NIpuf8x0gz0XTdrghDrGR756hX4KuqGT12fm9PpqciyT+52f7fkzIxCQ==", + "version": "13.0.0-dev.a7c6678.1625427504", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.a7c6678.1625427504.tgz", + "integrity": "sha512-S4ntnGVUCRyyOtz8YvoWNpSZyZEFwXTkTjXbU0shveD/QVT+0cBCcMX6vp0zPt3lCkMUgdW+crrOfEYKMGwKoQ==", "dependencies": { "@discordjs/builders": "^0.2.0", "@discordjs/collection": "^0.1.6", @@ -8035,9 +8034,9 @@ "integrity": "sha512-hNC38R9ZF4uaujaZQtQfm5CdQO58uhdkoHQAVvMfIL0LgOSZeW575W8H6upngQOuoxWd8tiRII3LLJm9zuQKYg==" }, "discord.js": { - "version": "13.0.0-dev.ab0b3b9.1625400166", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.ab0b3b9.1625400166.tgz", - "integrity": "sha512-nTdUyPEvy1OxCoSXVJrJDFMxEIEUr/NIpuf8x0gz0XTdrghDrGR756hX4KuqGT12fm9PpqciyT+52f7fkzIxCQ==", + "version": "13.0.0-dev.a7c6678.1625427504", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.a7c6678.1625427504.tgz", + "integrity": "sha512-S4ntnGVUCRyyOtz8YvoWNpSZyZEFwXTkTjXbU0shveD/QVT+0cBCcMX6vp0zPt3lCkMUgdW+crrOfEYKMGwKoQ==", "requires": { "@discordjs/builders": "^0.2.0", "@discordjs/collection": "^0.1.6", @@ -8872,7 +8871,6 @@ "knub": { "version": "file:../../Knub", "requires": { - "@discordjs/voice": "^0.5.1", "@types/chai": "^4.2.18", "@types/mocha": "^7.0.2", "@types/node": "^14.14.45", @@ -8880,7 +8878,7 @@ "@typescript-eslint/parser": "^4.23.0", "chai": "^4.3.4", "discord-api-types": "^0.18.1", - "discord.js": "^13.0.0-dev.ab0b3b9.1625400166", + "discord.js": "^13.0.0-dev.a7c6678.1625427504", "eslint": "^7.2.0", "husky": "^4.3.8", "knub-command-manager": "^9.1.0", diff --git a/backend/package.json b/backend/package.json index 5b045bca..75169098 100644 --- a/backend/package.json +++ b/backend/package.json @@ -29,7 +29,7 @@ "cors": "^2.8.5", "cross-env": "^5.2.0", "deep-diff": "^1.0.2", - "discord.js": "^13.0.0-dev.ab0b3b9.1625400166", + "discord.js": "^13.0.0-dev.a7c6678.1625427504", "dotenv": "^4.0.0", "emoji-regex": "^8.0.0", "erlpack": "github:discord/erlpack", diff --git a/backend/src/plugins/Automod/actions/setSlowmode.ts b/backend/src/plugins/Automod/actions/setSlowmode.ts index f2b9aeac..d0d286a8 100644 --- a/backend/src/plugins/Automod/actions/setSlowmode.ts +++ b/backend/src/plugins/Automod/actions/setSlowmode.ts @@ -30,7 +30,7 @@ export const SetSlowmodeAction = automodAction({ if (channel.type === ChannelTypeStrings.CATEGORY) { // Find all text channels within the category for (const ch of pluginData.guild.channels.cache.values()) { - if (ch.parentID === channel.id && ch.type === ChannelTypeStrings.TEXT) { + if (ch.parentId === channel.id && ch.type === ChannelTypeStrings.TEXT) { channelsToSlowmode.push(ch as TextChannel); } } diff --git a/backend/src/plugins/Automod/functions/runAutomod.ts b/backend/src/plugins/Automod/functions/runAutomod.ts index d3520402..bf22cc5e 100644 --- a/backend/src/plugins/Automod/functions/runAutomod.ts +++ b/backend/src/plugins/Automod/functions/runAutomod.ts @@ -13,7 +13,7 @@ export async function runAutomod(pluginData: GuildPluginData, const member = context.member || (userId && pluginData.guild.members.cache.get(userId as Snowflake)) || null; const channelId = context.message?.channel_id; const channel = channelId ? (pluginData.guild.channels.cache.get(channelId as Snowflake) as TextChannel) : null; - const categoryId = channel?.parentID; + const categoryId = channel?.parentId; const config = await pluginData.config.getMatchingConfig({ channelId, diff --git a/backend/src/plugins/BotControl/commands/ServersCmd.ts b/backend/src/plugins/BotControl/commands/ServersCmd.ts index e9bbf694..39938e3a 100644 --- a/backend/src/plugins/BotControl/commands/ServersCmd.ts +++ b/backend/src/plugins/BotControl/commands/ServersCmd.ts @@ -48,7 +48,7 @@ export const ServersCmd = botControlCmd({ const longestId = filteredGuilds.reduce((longest, guild) => Math.max(longest, guild.id.length), 0); const lines = filteredGuilds.map(g => { const paddedId = g.id.padEnd(longestId, " "); - const owner = getUser(pluginData.client, g.ownerID); + const owner = getUser(pluginData.client, g.ownerId); return `\`${paddedId}\` **${g.name}** (${g.memberCount} members) (owner **${owner.username}#${owner.discriminator}** \`${owner.id}\`)`; }); createChunkedMessage(msg.channel as TextChannel, lines.join("\n")); diff --git a/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts b/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts index 8752f632..bfd94cbe 100644 --- a/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts +++ b/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts @@ -16,7 +16,7 @@ export async function getCompanionChannelOptsForVoiceChannelId( .filter( opts => opts.voice_channel_ids.includes(voiceChannel.id) || - (voiceChannel.parentID && opts.voice_channel_ids.includes(voiceChannel.parentID)), + (voiceChannel.parentId && opts.voice_channel_ids.includes(voiceChannel.parentId)), ) .map(opts => Object.assign({}, defaultCompanionChannelOpts, opts)); } diff --git a/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts b/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts index fd4d756c..08507bac 100644 --- a/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts +++ b/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts @@ -34,7 +34,7 @@ export async function moveToVoiceChannelAction( if (!targetChannel) throw new ActionError("Unknown target channel"); if (!(targetChannel instanceof VoiceChannel)) throw new ActionError("Target channel is not a voice channel"); - if (!target.voice.channelID) return; + if (!target.voice.channelId) return; await target.edit({ channel: targetChannel.id, }); diff --git a/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts b/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts index 4591b228..3f241c65 100644 --- a/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts +++ b/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts @@ -30,6 +30,6 @@ function updateGuildInfo(pluginData: GuildPluginData) pluginData.guild.id, pluginData.guild.name, pluginData.guild.iconURL(), - pluginData.guild.ownerID, + pluginData.guild.ownerId, ); } diff --git a/backend/src/plugins/LocateUser/utils/moveMember.ts b/backend/src/plugins/LocateUser/utils/moveMember.ts index 312adda2..d3c85ecd 100644 --- a/backend/src/plugins/LocateUser/utils/moveMember.ts +++ b/backend/src/plugins/LocateUser/utils/moveMember.ts @@ -10,10 +10,10 @@ export async function moveMember( errorChannel: TextChannel, ) { const modMember: GuildMember = await pluginData.guild.members.fetch(toMoveID as Snowflake); - if (modMember.voice.channelID != null) { + if (modMember.voice.channelId != null) { try { await modMember.edit({ - channel: target.voice.channelID, + channel: target.voice.channelId, }); } catch { sendErrorMessage(pluginData, errorChannel, "Failed to move you. Are you in a voice channel?"); diff --git a/backend/src/plugins/LocateUser/utils/sendWhere.ts b/backend/src/plugins/LocateUser/utils/sendWhere.ts index 77b7dd56..dd6ddd69 100644 --- a/backend/src/plugins/LocateUser/utils/sendWhere.ts +++ b/backend/src/plugins/LocateUser/utils/sendWhere.ts @@ -11,8 +11,8 @@ export async function sendWhere( channel: TextChannel, prepend: string, ) { - const voice = member.voice.channelID - ? (pluginData.guild.channels.resolve(member.voice.channelID) as VoiceChannel) + const voice = member.voice.channelId + ? (pluginData.guild.channels.resolve(member.voice.channelId) as VoiceChannel) : null; if (voice == null) { diff --git a/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts b/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts index 6ce0b98a..38e2e2d9 100644 --- a/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts +++ b/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts @@ -8,7 +8,7 @@ export const LogsStageInstanceCreateEvt = logsEvt({ async listener(meta) { const stageChannel = meta.args.stageInstance.channel ?? - (await meta.pluginData.guild.channels.fetch(meta.args.stageInstance.channelID)); + (await meta.pluginData.guild.channels.fetch(meta.args.stageInstance.channelId)); meta.pluginData.state.guildLogs.log(LogType.STAGE_INSTANCE_CREATE, { stageInstance: stripObjectToScalars(meta.args.stageInstance), stageChannel: stripObjectToScalars(stageChannel), @@ -22,7 +22,7 @@ export const LogsStageInstanceDeleteEvt = logsEvt({ async listener(meta) { const stageChannel = meta.args.stageInstance.channel ?? - (await meta.pluginData.guild.channels.fetch(meta.args.stageInstance.channelID)); + (await meta.pluginData.guild.channels.fetch(meta.args.stageInstance.channelId)); meta.pluginData.state.guildLogs.log(LogType.STAGE_INSTANCE_DELETE, { stageInstance: stripObjectToScalars(meta.args.stageInstance), stageChannel: stripObjectToScalars(stageChannel), @@ -36,7 +36,7 @@ export const LogsStageInstanceUpdateEvt = logsEvt({ async listener(meta) { const stageChannel = meta.args.newStageInstance.channel ?? - (await meta.pluginData.guild.channels.fetch(meta.args.newStageInstance.channelID)); + (await meta.pluginData.guild.channels.fetch(meta.args.newStageInstance.channelId)); const diff = getScalarDifference(meta.args.oldStageInstance, meta.args.newStageInstance); const differenceString = differenceToString(diff); diff --git a/backend/src/plugins/Mutes/commands/MutesCmd.ts b/backend/src/plugins/Mutes/commands/MutesCmd.ts index 207693ec..fdc89c8b 100644 --- a/backend/src/plugins/Mutes/commands/MutesCmd.ts +++ b/backend/src/plugins/Mutes/commands/MutesCmd.ts @@ -27,10 +27,17 @@ export const MutesCmd = mutesCmd({ let totalMutes = 0; let hasFilters = false; - let stopCollectionFn; - let stopCollectionTimeout; + let stopCollectionFn = () => { + return; + }; + let stopCollectionTimeout: NodeJS.Timeout; const stopCollectionDebounce = 5 * MINUTES; + const bumpCollectionTimeout = () => { + clearTimeout(stopCollectionTimeout); + stopCollectionTimeout = setTimeout(stopCollectionFn, stopCollectionDebounce); + }; + let lines: string[] = []; // Active, logged mutes @@ -169,11 +176,6 @@ export const MutesCmd = mutesCmd({ bumpCollectionTimeout(); }; - const bumpCollectionTimeout = () => { - clearTimeout(stopCollectionTimeout); - stopCollectionTimeout = setTimeout(stopCollectionFn, stopCollectionDebounce); - }; - if (totalMutes === 0) { if (args.manual) { listMessage.edit("No manual mutes found!"); @@ -199,14 +201,14 @@ export const MutesCmd = mutesCmd({ new MessageButton() .setStyle("SECONDARY") .setEmoji("⬅") - .setCustomID(`previousButton:${idMod}`), + .setCustomId(`previousButton:${idMod}`), ); buttons.push( new MessageButton() .setStyle("SECONDARY") .setEmoji("➡") - .setCustomID(`nextButton:${idMod}`), + .setCustomId(`nextButton:${idMod}`), ); const row = new MessageActionRow().addComponents(buttons); @@ -223,10 +225,10 @@ export const MutesCmd = mutesCmd({ interaction.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true }); } else { collector.resetTimer(); - if (interaction.customID === `previousButton:${idMod}` && currentPage > 1) { + if (interaction.customId === `previousButton:${idMod}` && currentPage > 1) { await interaction.deferUpdate(); await drawListPage(currentPage - 1); - } else if (interaction.customID === `nextButton:${idMod}` && currentPage < totalPages) { + } else if (interaction.customId === `nextButton:${idMod}` && currentPage < totalPages) { await interaction.deferUpdate(); await drawListPage(currentPage + 1); } else { diff --git a/backend/src/plugins/ReactionRoles/commands/PostButtonRolesCmd.ts b/backend/src/plugins/ReactionRoles/commands/PostButtonRolesCmd.ts index aa74c553..f54ef9ad 100644 --- a/backend/src/plugins/ReactionRoles/commands/PostButtonRolesCmd.ts +++ b/backend/src/plugins/ReactionRoles/commands/PostButtonRolesCmd.ts @@ -38,7 +38,7 @@ export const PostButtonRolesCmd = reactionRolesCmd({ const btn = new MessageButton() .setLabel(button.label ?? "") .setStyle(button.style ?? "PRIMARY") - .setCustomID(customId) + .setCustomId(customId) .setDisabled(button.disabled ?? false); if (button.emoji) { diff --git a/backend/src/plugins/ReactionRoles/events/ButtonInteractionEvt.ts b/backend/src/plugins/ReactionRoles/events/ButtonInteractionEvt.ts index 47266478..2881b27d 100644 --- a/backend/src/plugins/ReactionRoles/events/ButtonInteractionEvt.ts +++ b/backend/src/plugins/ReactionRoles/events/ButtonInteractionEvt.ts @@ -14,18 +14,17 @@ import { handleModifyRole, handleOpenMenu } from "../util/buttonActionHandlers"; const BUTTON_INVALIDATION_TIME = 15 * MINUTES; export const ButtonInteractionEvt = reactionRolesEvt({ - event: "interaction", + event: "interactionCreate", async listener(meta) { const int = meta.args.interaction.isMessageComponent() ? (meta.args.interaction as MessageComponentInteraction) : null; if (!int) return; - const allOnMessage = await meta.pluginData.state.buttonRoles.getAllForMessageId(int.message.id); - if (allOnMessage.length === 0) return; + const cfg = meta.pluginData.config.get(); - const split = int.customID.split(BUTTON_CONTEXT_SEPARATOR); - const context = (await resolveStatefulCustomId(meta.pluginData, int.customID)) ?? { + const split = int.customId.split(BUTTON_CONTEXT_SEPARATOR); + const context = (await resolveStatefulCustomId(meta.pluginData, int.customId)) ?? { groupName: split[0], action: split[1], roleOrMenu: split[2], @@ -80,7 +79,7 @@ export const ButtonInteractionEvt = reactionRolesEvt({ } logger.warn( - `Action ${context.action} on button ${int.customID} (Guild: ${int.guildID}, Channel: ${int.channelID}) is unknown!`, + `Action ${context.action} on button ${int.customId} (Guild: ${int.guildId}, Channel: ${int.channelId}) is unknown!`, ); await sendEphemeralReply(int, `A internal error was encountered, please contact the Administrators!`); }, diff --git a/backend/src/plugins/ReactionRoles/util/buttonActionHandlers.ts b/backend/src/plugins/ReactionRoles/util/buttonActionHandlers.ts index 45205035..10f4e631 100644 --- a/backend/src/plugins/ReactionRoles/util/buttonActionHandlers.ts +++ b/backend/src/plugins/ReactionRoles/util/buttonActionHandlers.ts @@ -33,7 +33,7 @@ export async function handleOpenMenu( const btn = new MessageButton() .setLabel(menuButton.label ?? "") .setStyle("PRIMARY") - .setCustomID(customId) + .setCustomId(customId) .setDisabled(menuButton.disabled ?? false); if (menuButton.emoji) { diff --git a/backend/src/plugins/ReactionRoles/util/buttonCustomIdFunctions.ts b/backend/src/plugins/ReactionRoles/util/buttonCustomIdFunctions.ts index 9a758d0a..55113c7c 100644 --- a/backend/src/plugins/ReactionRoles/util/buttonCustomIdFunctions.ts +++ b/backend/src/plugins/ReactionRoles/util/buttonCustomIdFunctions.ts @@ -38,5 +38,7 @@ export async function resolveStatefulCustomId(pluginData: GuildPluginData= 1) rows.push(curRow); return rows; } diff --git a/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts b/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts index b0f485ce..eed30bd4 100644 --- a/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts +++ b/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts @@ -34,7 +34,7 @@ export const StarboardReactionAddEvt = starboardEvt({ const config = await pluginData.config.getMatchingConfig({ member, channelId: msg.channel.id, - categoryId: (msg.channel as TextChannel).parentID, + categoryId: (msg.channel as TextChannel).parentId, }); const boardLock = await pluginData.locks.acquire(allStarboardsLock()); diff --git a/backend/src/plugins/Tags/TagsPlugin.ts b/backend/src/plugins/Tags/TagsPlugin.ts index 220b896a..0ea369a0 100644 --- a/backend/src/plugins/Tags/TagsPlugin.ts +++ b/backend/src/plugins/Tags/TagsPlugin.ts @@ -150,6 +150,7 @@ export const TagsPlugin = zeppelinGuildPlugin()({ }, timeAdd(...args) { + if (args.length === 0) return; let reference; let delay; @@ -171,6 +172,7 @@ export const TagsPlugin = zeppelinGuildPlugin()({ }, timeSub(...args) { + if (args.length === 0) return; let reference; let delay; diff --git a/backend/src/plugins/Tags/util/onMessageCreate.ts b/backend/src/plugins/Tags/util/onMessageCreate.ts index a32ea6bc..43448df5 100644 --- a/backend/src/plugins/Tags/util/onMessageCreate.ts +++ b/backend/src/plugins/Tags/util/onMessageCreate.ts @@ -22,12 +22,12 @@ export async function onMessageCreate(pluginData: GuildPluginData = { jumbo_size: 128, can_avatar: false, info_on_single_result: true, + autojoin_threads: true, }, overrides: [ { @@ -148,6 +150,11 @@ export const UtilityPlugin = zeppelinGuildPlugin()({ EmojiInfoCmd, ], + // prettier-ignore + events: [ + AutoJoinThreadEvt, + ], + beforeLoad(pluginData) { const { state, guild } = pluginData; diff --git a/backend/src/plugins/Utility/commands/CleanCmd.ts b/backend/src/plugins/Utility/commands/CleanCmd.ts index e7024866..9186e3c8 100644 --- a/backend/src/plugins/Utility/commands/CleanCmd.ts +++ b/backend/src/plugins/Utility/commands/CleanCmd.ts @@ -98,7 +98,7 @@ export const CleanCmd = utilityCmd({ userId: msg.author.id, member: msg.member, channelId: targetChannel.id, - categoryId: targetChannel.parentID, + categoryId: targetChannel.parentId, }); if (configForTargetChannel.can_clean !== true) { sendErrorMessage(pluginData, msg.channel, `Missing permissions to use clean on that channel`); diff --git a/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts b/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts index b0a44755..d749b9c7 100644 --- a/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts +++ b/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts @@ -21,11 +21,11 @@ export const VcdisconnectCmd = utilityCmd({ return; } - if (!args.member.voice || !args.member.voice.channelID) { + if (!args.member.voice || !args.member.voice.channelId) { sendErrorMessage(pluginData, msg.channel, "Member is not in a voice channel"); return; } - const channel = pluginData.guild.channels.cache.get(args.member.voice.channelID) as VoiceChannel; + const channel = pluginData.guild.channels.cache.get(args.member.voice.channelId) as VoiceChannel; try { await args.member.voice.kick(); diff --git a/backend/src/plugins/Utility/commands/VcmoveCmd.ts b/backend/src/plugins/Utility/commands/VcmoveCmd.ts index c7d68008..784c5f4c 100644 --- a/backend/src/plugins/Utility/commands/VcmoveCmd.ts +++ b/backend/src/plugins/Utility/commands/VcmoveCmd.ts @@ -52,17 +52,17 @@ export const VcmoveCmd = utilityCmd({ channel = closestMatch; } - if (!args.member.voice || !args.member.voice.channelID) { + if (!args.member.voice || !args.member.voice.channelId) { sendErrorMessage(pluginData, msg.channel, "Member is not in a voice channel"); return; } - if (args.member.voice.channelID === channel.id) { + if (args.member.voice.channelId === channel.id) { sendErrorMessage(pluginData, msg.channel, "Member is already on that channel!"); return; } - const oldVoiceChannel = pluginData.guild.channels.cache.get(args.member.voice.channelID); + const oldVoiceChannel = pluginData.guild.channels.cache.get(args.member.voice.channelId); try { await args.member.edit({ diff --git a/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts b/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts new file mode 100644 index 00000000..c7d49d70 --- /dev/null +++ b/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts @@ -0,0 +1,12 @@ +import { utilityEvt } from "../types"; + +export const AutoJoinThreadEvt = utilityEvt({ + event: "threadCreate", + + async listener(meta) { + const config = meta.pluginData.config.get(); + if (config.autojoin_threads && meta.args.thread.joinable && !meta.args.thread.joined) { + await meta.args.thread.join(); + } + }, +}); diff --git a/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts b/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts index 356ba4bd..fa2ea87d 100644 --- a/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts @@ -105,11 +105,11 @@ export async function getChannelInfoEmbed( if (channel.type === ChannelTypeStrings.CATEGORY) { const textChannels = pluginData.guild.channels.cache.filter( - ch => ch.parentID === channel.id && ch.type !== ChannelTypeStrings.VOICE, + ch => ch.parentId === channel.id && ch.type !== ChannelTypeStrings.VOICE, ); const voiceChannels = pluginData.guild.channels.cache.filter( ch => - ch.parentID === channel.id && (ch.type === ChannelTypeStrings.VOICE || ch.type === ChannelTypeStrings.STAGE), + ch.parentId === channel.id && (ch.type === ChannelTypeStrings.VOICE || ch.type === ChannelTypeStrings.STAGE), ); embed.fields.push({ diff --git a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts index c413aff9..f6a00847 100644 --- a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts @@ -64,10 +64,10 @@ export async function getServerInfoEmbed( basicInformation.push(`Created: **${serverAge} ago** (\`${prettyCreatedAt}\`)`); if (thisServer) { - const owner = await resolveUser(pluginData.client, thisServer.ownerID); + const owner = await resolveUser(pluginData.client, thisServer.ownerId); const ownerName = `${owner.username}#${owner.discriminator}`; - basicInformation.push(`Owner: **${ownerName}** (\`${thisServer.ownerID}\`)`); + basicInformation.push(`Owner: **${ownerName}** (\`${thisServer.ownerId}\`)`); // basicInformation.push(`Voice region: **${thisServer.region}**`); Outdated, as automatic voice regions are fully live } @@ -81,10 +81,10 @@ export async function getServerInfoEmbed( }); // IMAGE LINKS - const iconUrl = `[Link](${(restGuild || guildPreview)!.iconURL})`; - const bannerUrl = restGuild?.bannerURL ? `[Link](${restGuild.bannerURL})` : "None"; + const iconUrl = `[Link](${(restGuild || guildPreview)!.iconURL()})`; + const bannerUrl = restGuild?.bannerURL() ? `[Link](${restGuild.bannerURL()})` : "None"; const splashUrl = - (restGuild || guildPreview)!.splashURL != null + (restGuild || guildPreview)!.splashURL() != null ? `[Link](${(restGuild || guildPreview)!.splashURL()?.replace("size=128", "size=2048")})` : "None"; diff --git a/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts b/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts index 96ed072a..e45d801b 100644 --- a/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts @@ -114,7 +114,7 @@ export async function getUserInfoEmbed( `), }); - const voiceChannel = member.voice.channelID ? pluginData.guild.channels.cache.get(member.voice.channelID) : null; + const voiceChannel = member.voice.channelId ? pluginData.guild.channels.cache.get(member.voice.channelId) : null; if (voiceChannel || member.voice.mute || member.voice.deaf) { embed.fields.push({ name: preEmbedPadding + "Voice information", diff --git a/backend/src/plugins/Utility/search.ts b/backend/src/plugins/Utility/search.ts index c4a78c15..40bd1d1b 100644 --- a/backend/src/plugins/Utility/search.ts +++ b/backend/src/plugins/Utility/search.ts @@ -175,7 +175,7 @@ export async function displaySearch( new MessageButton() .setStyle("SECONDARY") .setEmoji("⬅") - .setCustomID(`previousButton:${idMod}`) + .setCustomId(`previousButton:${idMod}`) .setDisabled(currentPage === 1), ); @@ -183,7 +183,7 @@ export async function displaySearch( new MessageButton() .setStyle("SECONDARY") .setEmoji("➡") - .setCustomID(`nextButton:${idMod}`) + .setCustomId(`nextButton:${idMod}`) .setDisabled(currentPage === searchResult.lastPage), ); @@ -191,7 +191,7 @@ export async function displaySearch( new MessageButton() .setStyle("SECONDARY") .setEmoji("🔄") - .setCustomID(`reloadButton:${idMod}`), + .setCustomId(`reloadButton:${idMod}`), ); const row = new MessageActionRow().addComponents(buttons); @@ -204,15 +204,15 @@ export async function displaySearch( if (msg.author.id !== interaction.user.id) { interaction.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true }); } else { - if (interaction.customID === `previousButton:${idMod}` && currentPage > 1) { + if (interaction.customId === `previousButton:${idMod}` && currentPage > 1) { collector.stop(); await interaction.deferUpdate(); await loadSearchPage(currentPage - 1); - } else if (interaction.customID === `nextButton:${idMod}` && currentPage < searchResult.lastPage) { + } else if (interaction.customId === `nextButton:${idMod}` && currentPage < searchResult.lastPage) { collector.stop(); await interaction.deferUpdate(); await loadSearchPage(currentPage + 1); - } else if (interaction.customID === `reloadButton:${idMod}`) { + } else if (interaction.customId === `reloadButton:${idMod}`) { collector.stop(); await interaction.deferUpdate(); await loadSearchPage(currentPage); @@ -325,7 +325,7 @@ async function performMemberSearch( } if (args.voice) { - matchingMembers = matchingMembers.filter(m => m.voice.channelID != null); + matchingMembers = matchingMembers.filter(m => m.voice.channelId != null); } if (args.bot) { diff --git a/backend/src/plugins/Utility/types.ts b/backend/src/plugins/Utility/types.ts index 6d02be57..15f6e925 100644 --- a/backend/src/plugins/Utility/types.ts +++ b/backend/src/plugins/Utility/types.ts @@ -34,6 +34,7 @@ export const ConfigSchema = t.type({ jumbo_size: t.Integer, can_avatar: t.boolean, info_on_single_result: t.boolean, + autojoin_threads: t.boolean, }); export type TConfigSchema = t.TypeOf; diff --git a/backend/src/utils/waitForInteraction.ts b/backend/src/utils/waitForInteraction.ts index d3ac1b7d..f984cdd4 100644 --- a/backend/src/utils/waitForInteraction.ts +++ b/backend/src/utils/waitForInteraction.ts @@ -13,12 +13,12 @@ export async function waitForButtonConfirm( new MessageButton() .setStyle("SUCCESS") .setLabel(options?.confirmText || "Confirm") - .setCustomID(`confirmButton:${idMod}`), + .setCustomId(`confirmButton:${idMod}`), new MessageButton() .setStyle("DANGER") .setLabel(options?.cancelText || "Cancel") - .setCustomID(`cancelButton:${idMod}`), + .setCustomId(`cancelButton:${idMod}`), ]); const message = await channel.send({ ...toPost, components: [row] }); @@ -29,10 +29,10 @@ export async function waitForButtonConfirm( if (options?.restrictToId && options.restrictToId !== interaction.user.id) { interaction.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true }); } else { - if (interaction.customID === `confirmButton:${idMod}`) { + if (interaction.customId === `confirmButton:${idMod}`) { message.delete(); resolve(true); - } else if (interaction.customID === `cancelButton:${idMod}`) { + } else if (interaction.customId === `cancelButton:${idMod}`) { message.delete(); resolve(false); }