Skip to content

Commit

Permalink
Skip and better formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dcadenas committed Mar 29, 2024
1 parent 1f71218 commit 7286dd8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/lib/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class Slack {
static async postManualVerification(reportRequest) {
try {
const messagePayload = this.createSlackMessagePayload(reportRequest);
const result = await web.chat.postMessage();
await web.chat.postMessage(messagePayload);

console.log(
`Sent event ${reportRequest.reportedEvent.id} to Slack for manual evaluation.`
Expand All @@ -28,7 +28,7 @@ export default class Slack {
}

static createSlackMessagePayload(reportRequest) {
const longText = `Pubkey ${reportRequest.reporterPubkey} reported an event:\n\`\`\`\n${reportRequest.reporterText}\n\`\`\``;
const longText = `Pubkey \`${reportRequest.reporterPubkey}\` reported an event:\n\`\`\`\n${reportRequest.reporterText}\n\`\`\``;

const shortText = `${reportRequest.reporterPubkey} reported event ${reportRequest.reportedEvent.id}`;

Expand All @@ -49,6 +49,16 @@ export default class Slack {
}
);

elements.unshift({
type: "button",
text: {
type: "plain_text",
text: "Skip",
},
value: "skip",
action_id: "skip",
});

return {
channel: channelId,
text: shortText,
Expand Down

0 comments on commit 7286dd8

Please sign in to comment.