This commit is contained in:
Isaac 2022-08-06 22:55:36 +01:00
parent ae72266b82
commit fcd390bc9d
No known key found for this signature in database
GPG Key ID: F4EAABEB0FFCC06A

View File

@ -26,6 +26,7 @@ module.exports = class TicketManager {
categoryId, interaction, topic, reference, categoryId, interaction, topic, reference,
}) { }) {
const cacheKey = `cache/category+guild+questions:${categoryId}`; const cacheKey = `cache/category+guild+questions:${categoryId}`;
/** @type {import('@prisma/client').Category} */
let category = await this.client.keyv.get(cacheKey); let category = await this.client.keyv.get(cacheKey);
if (!category) { if (!category) {
category = await this.client.prisma.category.findUnique({ category = await this.client.prisma.category.findUnique({
@ -66,7 +67,7 @@ module.exports = class TicketManager {
const getMessage = this.client.i18n.getLocale(category.guild.locale); const getMessage = this.client.i18n.getLocale(category.guild.locale);
const rlKey = `ratelimits/guild-user:${interaction.guild.id}-${interaction.user.id}`; const rlKey = `ratelimits/guild-user:${category.guildId}-${interaction.user.id}`;
const rl = await this.client.keyv.get(rlKey); const rl = await this.client.keyv.get(rlKey);
if (rl) { if (rl) {
const embed = new EmbedBuilder() const embed = new EmbedBuilder()