mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-05 12:23:09 +02: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:
parent
0952d7fc37
commit
76572c5d18
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user