From d3ba831615c6a6112d600d3e282e16cb182f8f78 Mon Sep 17 00:00:00 2001 From: adan-ea <57812567+adan-ea@users.noreply.github.com> Date: Sat, 25 Nov 2023 00:53:40 +0100 Subject: [PATCH] fix: Add report file & tempVoice emote --- package-lock.json | 4 +-- package.json | 2 +- src/modules/core/commands/misc/report.ts | 25 ++++++++++++++----- .../buttons/voiceWhitelistRemoveBtn.ts | 2 +- src/utils/voiceUtil.ts | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2966f35..879e4f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "adroid_ea", - "version": "3.7.0", + "version": "3.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "adroid_ea", - "version": "3.7.0", + "version": "3.7.1", "license": "ISC", "dependencies": { "ansis": "^1.5.5", diff --git a/package.json b/package.json index 90a6e2d..f306e78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adroid_ea", - "version": "3.7.0", + "version": "3.7.1", "description": "", "main": "index.js", "scripts": { diff --git a/src/modules/core/commands/misc/report.ts b/src/modules/core/commands/misc/report.ts index 92b9307..9cd7130 100644 --- a/src/modules/core/commands/misc/report.ts +++ b/src/modules/core/commands/misc/report.ts @@ -4,6 +4,7 @@ import { Client, EmbedBuilder, ForumChannel, + GuildForumThreadMessageCreateOptions, PermissionsBitField } from 'discord.js'; import { Channels, Colors, Guilds } from '../../../../utils/consts'; @@ -40,7 +41,13 @@ export default { name: 'description', description: 'La description du bug', type: ApplicationCommandOptionType.String, - required: true + required: false + }, + { + name: 'fichier', + description: 'Les pièces jointes du bug', + type: ApplicationCommandOptionType.Attachment, + required: false } ] }, @@ -55,7 +62,8 @@ export default { await interaction.deferReply({ ephemeral: true }); const issue = interaction.options.getString('type', true); const title = interaction.options.getString('title', true); - const description = interaction.options.getString('description', true); + const description = interaction.options.getString('description', false); + const attachment = interaction.options.getAttachment('fichier', false); const embed = new EmbedBuilder() .setAuthor({ @@ -64,18 +72,23 @@ export default { }) .setTitle(`**${title}**`) .setDescription(description ?? '*Aucune description*') - .setColor(Colors.Random) + .setColor(Colors.random) .setTimestamp(); + const message: GuildForumThreadMessageCreateOptions = { + embeds: [embed] + }; + + if (attachment) { + message.files = [attachment]; + } const bugChannel = client.guilds.cache .get(Guilds.adanLab) ?.channels.cache.get(Channels.issues) as ForumChannel; const thread = await bugChannel.threads.create({ name: title, - message: { - embeds: [embed] - }, + message, appliedTags: [bugChannel.availableTags.find(tag => tag.name === issue)!.id] }); await interaction.editReply({ diff --git a/src/modules/tempVoice/components/buttons/voiceWhitelistRemoveBtn.ts b/src/modules/tempVoice/components/buttons/voiceWhitelistRemoveBtn.ts index 3396df7..ec1092c 100644 --- a/src/modules/tempVoice/components/buttons/voiceWhitelistRemoveBtn.ts +++ b/src/modules/tempVoice/components/buttons/voiceWhitelistRemoveBtn.ts @@ -4,7 +4,7 @@ import { buildVoiceWhitelistRemoveRow } from '../selectMenus'; import { getorCreateUserSettings } from '../../../../utils/modulesUil'; export const voiceWhitelistRemoveBtn = new ButtonBuilder() .setCustomId('voiceWhitelistRemoveBtn') - .setEmoji('<:untrust:1176809428981391380>') + .setEmoji('<:untrust:1177755536679251978>') .setStyle(ButtonStyle.Secondary); export default { diff --git a/src/utils/voiceUtil.ts b/src/utils/voiceUtil.ts index 3afacf8..986acc3 100644 --- a/src/utils/voiceUtil.ts +++ b/src/utils/voiceUtil.ts @@ -209,7 +209,7 @@ export const buildVoiceEmbed = (memberId: string) => { - 📗 Whitelist - <:tempWL:1177705708628746250> Whitelist Temporairement -- <:untrust:1176809428981391380> Retirer de la Whitelist +- <:untrust:1177755536679251978> Retirer de la Whitelist - 📕 Blacklist - 📤 Retirer de la Blacklist` )