mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-02 00:31:27 +03:00
Update ticket's updatedAt property in msg event
This allows for messages to be closeall'd by the last message rather than creation date
This commit is contained in:
@@ -30,7 +30,12 @@ Type \`${config.prefix}new\` on the server to create a new ticket.`);
|
||||
*/
|
||||
|
||||
let ticket = await Ticket.findOne({ where: { channel: message.channel.id } });
|
||||
if (ticket) archive.add(message); // add message to archive
|
||||
if (ticket) {
|
||||
archive.add(message); // add message to archive
|
||||
// Update the ticket updated at so closeall can get most recent
|
||||
ticket.changed('updatedAt', true);
|
||||
ticket.save();
|
||||
}
|
||||
|
||||
if (message.author.bot || message.author.id === client.user.id) return; // goodbye bots
|
||||
|
||||
|
Reference in New Issue
Block a user