Skip to content

Commit

Permalink
fix: move report channel to forum post
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Oct 3, 2023
1 parent 6c2a2a4 commit 3dbc5b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/Commands/Apps/messageInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActionRowBuilder, ApplicationCommandType, AttachmentBuilder, ButtonBuilder, ButtonStyle, ComponentType, ContextMenuCommandBuilder, EmbedBuilder, GuildTextBasedChannel, MessageContextMenuCommandInteraction, ModalBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextInputBuilder, TextInputStyle } from 'discord.js';
import { ActionRowBuilder, ApplicationCommandType, AttachmentBuilder, ButtonBuilder, ButtonStyle, ComponentType, ContextMenuCommandBuilder, EmbedBuilder, MessageContextMenuCommandInteraction, ModalBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextInputBuilder, TextInputStyle, ThreadChannel } from 'discord.js';
import { constants, getDb } from '../../Utils/utils';
import { stripIndents } from 'common-tags';
import { profileImage } from 'discord-arts';
Expand Down Expand Up @@ -191,7 +191,7 @@ export default {
return;
}

const reportsChannel = await i.client.channels.fetch(constants.channel.reports) as GuildTextBasedChannel;
const reportsChannel = await i.client.channels.fetch(constants.channel.reports) as ThreadChannel;
const reportedUser = await i.client.users.fetch(networkMessage.authorId);

// network channelId in chatbot hq
Expand Down Expand Up @@ -298,6 +298,7 @@ export default {
);

await reportsChannel?.send({
content: '<@&1088677008260726854>', // ping network mods role
embeds: [reportEmbed],
components: [jumpButton],
});
Expand Down
10 changes: 5 additions & 5 deletions src/Scripts/support/report.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { captureMessage } from '@sentry/node';
import { stripIndents } from 'common-tags';
import { ActionRowBuilder, EmbedBuilder, TextInputBuilder, ModalBuilder, TextInputStyle, ChatInputCommandInteraction, ForumChannel, TextChannel, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ComponentType } from 'discord.js';
import { ActionRowBuilder, EmbedBuilder, TextInputBuilder, ModalBuilder, TextInputStyle, ChatInputCommandInteraction, ForumChannel, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ComponentType, ThreadChannel } from 'discord.js';
import { constants } from '../../Utils/utils';
import logger from '../../Utils/logger';
import emojis from '../../Utils/JSON/emoji.json';
Expand Down Expand Up @@ -150,7 +150,7 @@ export default {
await interaction.showModal(reportModal);
interaction.awaitModalSubmit({ time: 60000 * 5, filter: (i) => i.user.id === interaction.user.id && i.customId === reportModal.data.custom_id })
.then(async modalInteraction => {
const reportChannel = await modalInteraction.client.channels.fetch(constants.channel.reports).catch(() => null) as TextChannel | null;
const reportChannel = await modalInteraction.client.channels.fetch(constants.channel.reports).catch(() => null) as ThreadChannel | null;
const reportDescription = modalInteraction.fields.getTextInputValue('description');

switch (reportType) {
Expand All @@ -175,7 +175,7 @@ export default {
.setFields({ name: 'Reason for report', value: reportDescription })
.setThumbnail(reportedUser.avatarURL({ size: 2048 }) ?? reportedUser.defaultAvatarURL)
.setFooter({ text: `Reported by ${interaction.user.username} (${interaction.user.id})`, iconURL: interaction.user.avatarURL() || interaction.user.defaultAvatarURL });
await reportChannel?.send({ embeds: [userReport] });
await reportChannel?.send({ content: '<@&1088677008260726854>', embeds: [userReport] });
break;
}

Expand All @@ -200,7 +200,7 @@ export default {
.setFields({ name: 'Reason for report', value: reportDescription })
.setThumbnail(reportedServer.iconURL({ size: 2048 }))
.setFooter({ text: `Reported by ${interaction.user.username} (${interaction.user.id})`, iconURL: interaction.user.avatarURL() || interaction.user.defaultAvatarURL });
await reportChannel?.send({ embeds: [serverReport] });
await reportChannel?.send({ content: '<@&1088677008260726854>', embeds: [serverReport] });
break;
}
default: {
Expand All @@ -210,7 +210,7 @@ export default {
.setDescription('**Type:** Other')
.setFields({ name: 'Description', value: reportDescription })
.setFooter({ text: `Reported by ${interaction.user.username} (${interaction.user.id})`, iconURL: interaction.user.avatarURL() || interaction.user.defaultAvatarURL });
await reportChannel?.send({ embeds: [otherReport] });
await reportChannel?.send({ content: '<@&1088677008260726854>', embeds: [otherReport] });
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const constants = {
bugs: '1035135196053393418',
networklogs: '1156144879869632553',
modlogs: '1042265633896796231',
reports: '821610981155012628',
reports: '1158773603551162398',
goal: '906460473065615403',
suggestions: '1021256657528954900',
},
Expand Down

0 comments on commit 3dbc5b2

Please sign in to comment.