mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 08:13:09 +02:00
Add ticket first response
This commit is contained in:
parent
ce6e2b7d8f
commit
96ec85f14a
@ -9,7 +9,9 @@ const {
|
|||||||
SelectMenuBuilder,
|
SelectMenuBuilder,
|
||||||
SelectMenuOptionBuilder,
|
SelectMenuOptionBuilder,
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
const { getCommonGuilds } = require('../../lib/users');
|
const {
|
||||||
|
getCommonGuilds, isStaff,
|
||||||
|
} = require('../../lib/users');
|
||||||
const ms = require('ms');
|
const ms = require('ms');
|
||||||
const emoji = require('node-emoji');
|
const emoji = require('node-emoji');
|
||||||
|
|
||||||
@ -192,14 +194,16 @@ module.exports = class extends Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ticket.firstResponseAt === null) {
|
const data = { lastMessageAt: new Date() };
|
||||||
|
if (
|
||||||
|
ticket.firstResponseAt === null &&
|
||||||
|
await isStaff(message.guild, message.author.id)
|
||||||
|
) data.firstResponseAt = new Date();
|
||||||
ticket = await client.prisma.ticket.update({
|
ticket = await client.prisma.ticket.update({
|
||||||
data: { firstResponseAt: new Date() },
|
data,
|
||||||
where: { id: ticket.id },
|
where: { id: ticket.id },
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: lastMessageAt
|
|
||||||
// TODO: staff status alert, working hours alerts
|
// TODO: staff status alert, working hours alerts
|
||||||
} else {
|
} else {
|
||||||
// TODO: auto tag
|
// TODO: auto tag
|
||||||
|
Loading…
Reference in New Issue
Block a user