mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
refactor: ticket logs
This commit is contained in:
parent
cdfdf72026
commit
22b15d7fd7
@ -138,6 +138,8 @@ async function logTicketEvent(client, {
|
|||||||
const member = await guild.members.fetch(userId);
|
const member = await guild.members.fetch(userId);
|
||||||
client.log.info.tickets(`${member.user.tag} ${client.i18n.getMessage('en-GB', `log.ticket.verb.${action}`)} ticket ${target.id}`);
|
client.log.info.tickets(`${member.user.tag} ${client.i18n.getMessage('en-GB', `log.ticket.verb.${action}`)} ticket ${target.id}`);
|
||||||
if (!ticket.guild.logChannel) return;
|
if (!ticket.guild.logChannel) return;
|
||||||
|
const channel = client.channels.cache.get(ticket.guild.logChannel);
|
||||||
|
if (!channel) return;
|
||||||
const colour = action === 'create'
|
const colour = action === 'create'
|
||||||
? 'Aqua' : action === 'close'
|
? 'Aqua' : action === 'close'
|
||||||
? 'DarkAqua' : action === 'update'
|
? 'DarkAqua' : action === 'update'
|
||||||
@ -149,8 +151,6 @@ async function logTicketEvent(client, {
|
|||||||
user: `<@${member.user.id}>`,
|
user: `<@${member.user.id}>`,
|
||||||
verb: getMessage(`log.ticket.verb.${action}`),
|
verb: getMessage(`log.ticket.verb.${action}`),
|
||||||
};
|
};
|
||||||
const channel = client.channels.cache.get(ticket.guild.logChannel);
|
|
||||||
if (!channel) return;
|
|
||||||
const embeds = [
|
const embeds = [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setColor(colour)
|
.setColor(colour)
|
||||||
@ -238,4 +238,4 @@ module.exports = {
|
|||||||
logAdminEvent,
|
logAdminEvent,
|
||||||
logMessageEvent,
|
logMessageEvent,
|
||||||
logTicketEvent,
|
logTicketEvent,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user