-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add anonymous message reporting mechanism (#199)
* Command handler setup * Move emojiMod helper out into helpers/modLog * Change emojiMod to use cached log channels * Add anonymous report command * Use interactions * Fix ssh action name
- Loading branch information
Showing
8 changed files
with
103 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ApplicationCommandType } from "discord-api-types/v9"; | ||
import { Message, MessageContextMenuInteraction } from "discord.js"; | ||
import { ReportReasons } from "../constants"; | ||
import { constructLog, reportUser } from "../helpers/modLog"; | ||
|
||
export const name = "report-message"; | ||
export const description = "Anonymously report this message"; | ||
export const type = ApplicationCommandType.Message; | ||
export const handler = async (interaction: MessageContextMenuInteraction) => { | ||
const message = interaction.targetMessage; | ||
if (!(message instanceof Message)) { | ||
return; | ||
} | ||
|
||
reportUser(message, constructLog(ReportReasons.anonReport, [], [], message)); | ||
|
||
await interaction.reply({ | ||
ephemeral: true, | ||
content: "This message has been reported anonymously", | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters