mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 17:23:08 +02:00
Closes #288
This commit is contained in:
parent
7b692facc1
commit
0a10d91f8d
@ -9,7 +9,22 @@ module.exports = class extends Listener {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(guild) {
|
/**
|
||||||
|
* @param {import("discord.js").Guild} guild
|
||||||
|
*/
|
||||||
|
async run(guild) {
|
||||||
|
/** @type {import("client")} */
|
||||||
|
const client = this.client;
|
||||||
|
|
||||||
this.client.log.success(`Added to guild "${guild.name}"`);
|
this.client.log.success(`Added to guild "${guild.name}"`);
|
||||||
|
let settings = await client.prisma.guild.findUnique({ where: { id: guild.id } });
|
||||||
|
if (!settings) {
|
||||||
|
settings = await client.prisma.guild.create({
|
||||||
|
data: {
|
||||||
|
id: guild.id,
|
||||||
|
locale: client.i18n.locales.includes(guild.preferredLocale) ? guild.preferredLocale : 'en-GB',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user