Skip to content

Commit

Permalink
fix(deleteMsg): allow hub owner to delete messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Sep 10, 2023
1 parent 284b98a commit 17e3b99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Commands/Network/deleteMsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export default {
}

const interchatStaff = checkIfStaff(interaction.user.id);
if (!messageInDb.hub?.moderators.find((m) => m.userId === interaction.user.id) && !interchatStaff && interaction.user.id !== messageInDb.authorId) {
if (
!interchatStaff &&
!messageInDb.hub?.moderators.find((m) => m.userId === interaction.user.id) &&
messageInDb.hub?.ownerId !== interaction.user.id &&
interaction.user.id !== messageInDb.authorId
) {
return interaction.reply({
content: `${emoji.no} You are not the author of this message.`,
ephemeral: true,
Expand Down

0 comments on commit 17e3b99

Please sign in to comment.