Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FirezTheGreat committed Oct 24, 2022
1 parent 30879de commit 91d8369
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions events/client/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,29 @@ module.exports = class interactionCreate extends Event {
],
type: OverwriteType.Member
},
{
id: Roles.ModeratorRoleId,
allow: [
PermissionFlagsBits.ViewChannel, PermissionFlagsBits.SendMessages,
PermissionFlagsBits.EmbedLinks, PermissionFlagsBits.AttachFiles,
PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.AddReactions
],
type: OverwriteType.Role
},
{
id: Roles.SeniorModeratorRoleId,
allow: [
PermissionFlagsBits.ViewChannel, PermissionFlagsBits.SendMessages,
PermissionFlagsBits.EmbedLinks, PermissionFlagsBits.AttachFiles,
PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.AddReactions,
PermissionFlagsBits.ManageMessages, PermissionFlagsBits.MentionEveryone
],
type: OverwriteType.Role
},
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.ViewChannel]
deny: [PermissionFlagsBits.ViewChannel],
type: OverwriteType.Role
}
]
});
Expand Down Expand Up @@ -186,8 +206,8 @@ module.exports = class interactionCreate extends Event {
player.tickets[ticket_index].active = false;
player.tickets[ticket_index].ended_timestamp = Date.now();

player.tickets[ticket_index].transcript = (await interaction.channel.messages.fetch({ cache: false })).filter((_, index) => index !== 0).mapValues((message) =>
`${time(message.createdTimestamp, TimestampStyles.ShortTime)} —— ${message.cleanContent ? `Content — ${message.cleanContent}\n\n` : ''}${message.attachments.size ? `Attachments — ${message.attachments.mapValues(({ url }) => url).join('\n')}` : ''}`
player.tickets[ticket_index].transcript = (await interaction.channel.messages.fetch({ cache: false })).filter((_, index) => index !== 0).map((message) =>
`${time(message.createdTimestamp, TimestampStyles.ShortTime)} —— ${message.cleanContent ? `Content — ${message.cleanContent}\n\n` : ''}${message.attachments.size ? `Attachments — ${message.attachments.map(({ url }) => url).join('\n')}` : ''}`
);

await Players.findOneAndUpdate(
Expand Down

0 comments on commit 91d8369

Please sign in to comment.