mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-22 15:53:08 +02:00
fix: 🤦♂️ inflated ticket count and negative response times in stats
This commit is contained in:
parent
f164fad9ba
commit
32697c6d13
@ -38,7 +38,7 @@ module.exports.sendToHouston = async client => {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}).map(guild => {
|
}).map(guild => {
|
||||||
const closedTickets = guild.tickets.filter(t => t.closedAt);
|
const closedTickets = guild.tickets.filter(t => t.firstResponseAt && t.closedAt);
|
||||||
return {
|
return {
|
||||||
avg_resolution_time: msToMins(closedTickets.reduce((total, ticket) => total + (ticket.closedAt - ticket.createdAt), 0) ?? 1 / closedTickets.length),
|
avg_resolution_time: msToMins(closedTickets.reduce((total, ticket) => total + (ticket.closedAt - ticket.createdAt), 0) ?? 1 / closedTickets.length),
|
||||||
avg_response_time: msToMins(closedTickets.reduce((total, ticket) => total + (ticket.firstResponseAt - ticket.createdAt), 0) ?? 1 / closedTickets.length),
|
avg_response_time: msToMins(closedTickets.reduce((total, ticket) => total + (ticket.firstResponseAt - ticket.createdAt), 0) ?? 1 / closedTickets.length),
|
||||||
@ -58,7 +58,7 @@ module.exports.sendToHouston = async client => {
|
|||||||
locale: guild.locale,
|
locale: guild.locale,
|
||||||
members: client.guilds.cache.get(guild.id).memberCount,
|
members: client.guilds.cache.get(guild.id).memberCount,
|
||||||
messages: users.reduce((total, user) => total + user.messageCount, 0), // global not guild, don't count archivedMessage table rows, they can be deleted
|
messages: users.reduce((total, user) => total + user.messageCount, 0), // global not guild, don't count archivedMessage table rows, they can be deleted
|
||||||
tickets: guilds.reduce((total, guild) => total + guild.tickets.length, 0),
|
tickets: guild.tickets.length,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
id: md5(client.user.id),
|
id: md5(client.user.id),
|
||||||
|
Loading…
Reference in New Issue
Block a user