Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix start report restoring messages #279

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ bot.once('ready', async () => {
const startReportCommand = bot.stores.get('commands').get('start-report');
const startReportError = await startReportCommand.tryRestoreReactionListeners(guild);
if (startReportError) {
mainLogger.warning(roleSelectorError);
mainLogger.warning(startReportError);
} else {
mainLogger.verbose('Restored role selector command message');
mainLogger.verbose('Restored start report command message');
}
}

Expand Down
10 changes: 5 additions & 5 deletions commands/hacker_utility/start-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class StartReport extends Command {
interaction.reply({ content: 'Report started!', ephemeral: true });
const msg = await interaction.channel.send({ embeds: [embed], components: [row] });

await this.listenToReports(interaction, msg);
await this.listenToReports(interaction.guild, msg);

const savedMessagesCol = firebaseUtil.getSavedMessagesSubCol(interaction.guild.id);
await savedMessagesCol.doc('report').set({
Expand All @@ -74,10 +74,10 @@ class StartReport extends Command {

/**
*
* @param {Command.ChatInputInteraction} interaction
* @param {Guild} guild
* @param {Message<boolean>} msg
*/
async listenToReports(interaction, msg) {
async listenToReports(guild, msg) {
const checkInCollector = msg.createMessageComponentCollector({ filter: i => !i.user.bot});

checkInCollector.on('collect', async i => {
Expand Down Expand Up @@ -106,9 +106,9 @@ class StartReport extends Command {
const issueMessage = submitted.fields.getTextInputValue('issueMessage');

try {
discordLog(interaction.guild, `<@&${interaction.guild.roleIDs.staffRole}> New anonymous report:\n\n ${issueMessage}`);
discordLog(guild, `<@&${guild.roleIDs.staffRole}> New anonymous report:\n\n ${issueMessage}`);
} catch {
discordLog(interaction.guild, `New anonymous report:\n\n ${issueMessage}`);
discordLog(guild, `New anonymous report:\n\n ${issueMessage}`);
}
submitted.reply({ content: 'Thank you for taking the time to report users who are not following server or MLH rules. You help makes our community safer!', ephemeral: true });
return;
Expand Down
Loading