Skip to content

Commit

Permalink
🔄 Change name: save < edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashu11-A committed Jun 7, 2024
1 parent 234f709 commit 291e475
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/tickets/src/discord/events/ticketMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ new Event({
name: 'messageCreate',
async run(message) {
if (!message.inGuild()) return
const { channelId, author, content, id } = message
const { channelId, author, content, id, client } = message
if (author.id === client.user.id) return
const ticketData = await ticket.findOne({ where: { channelId: channelId } })
if (ticketData === null) return

Expand All @@ -32,7 +33,7 @@ new Event({
role,
date: new Date()
})
.save({ id: ticketData.id })
.edit({ id: ticketData.id })
console.log(`💬 Nova mensagem salva! TicketId: ${ticketData.id}`)
},
})
Expand All @@ -54,7 +55,7 @@ new Event({
}

const builder = new TicketBuilder({ interaction: message })
await builder.setData(ticketData).save({ id: ticketData.id })
await builder.setData(ticketData).edit({ id: ticketData.id })
console.info(`⚠️ Uma mensagem foi apagada! ticketId: ${ticketData.id}`)
},
})

0 comments on commit 291e475

Please sign in to comment.