Skip to content

Commit

Permalink
fix: Add report file & tempVoice emote
Browse files Browse the repository at this point in the history
  • Loading branch information
adan-ea committed Nov 24, 2023
1 parent 98dd87a commit d3ba831
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adroid_ea",
"version": "3.7.0",
"version": "3.7.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
25 changes: 19 additions & 6 deletions src/modules/core/commands/misc/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Client,
EmbedBuilder,
ForumChannel,
GuildForumThreadMessageCreateOptions,
PermissionsBitField
} from 'discord.js';
import { Channels, Colors, Guilds } from '../../../../utils/consts';
Expand Down Expand Up @@ -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
}
]
},
Expand All @@ -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({
Expand All @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/voiceUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
Expand Down

0 comments on commit d3ba831

Please sign in to comment.