diff --git a/index.js b/index.js index 4293af7..79eba2f 100644 --- a/index.js +++ b/index.js @@ -95,43 +95,43 @@ client.on('ready', async () => { const sendMessages = async (data) => { const channel = await client.channels.fetch(process.env.DISCORD_BANLOG_CHANNEL_ID); - embed = { - fields: [ - { - name: "Banned Username", - value: thisBan.banned_username, - inline: true - }, - { - name: "Banned ID", - value: thisBan.banned_id, - inline: true - }, - { - name: "Banned", - value: ` `, - inline: true - }, - { - name: "Expires", - value: ` `, - inline: true - }, - { - name: "Reason", - value: thisBan.reason, - inline: true - }, - { - name: "Moderator", - value: thisBan.moderator, - inline: true - } - ] - } - for (const ban in data.added) { thisBan = data.added[ban] + embed = { + fields: [ + { + name: "Banned Username", + value: thisBan.banned_username, + inline: true + }, + { + name: "Banned ID", + value: thisBan.banned_id, + inline: true + }, + { + name: "Banned", + value: ` `, + inline: true + }, + { + name: "Expires", + value: ` `, + inline: true + }, + { + name: "Reason", + value: thisBan.reason, + inline: true + }, + { + name: "Moderator", + value: thisBan.moderator, + inline: true + } + ] + } + embed.title = "Ban Added" embed.color = 0xff0000 channel.send({ embeds: [embed] }) @@ -140,6 +140,41 @@ const sendMessages = async (data) => { for (const ban in data.removed) { thisBan = data.removed[ban] + embed = { + fields: [ + { + name: "Banned Username", + value: thisBan.banned_username, + inline: true + }, + { + name: "Banned ID", + value: thisBan.banned_id, + inline: true + }, + { + name: "Banned", + value: ` `, + inline: true + }, + { + name: "Expires", + value: ` `, + inline: true + }, + { + name: "Reason", + value: thisBan.reason, + inline: true + }, + { + name: "Moderator", + value: thisBan.moderator, + inline: true + } + ] + } + embed.title = "Ban Removed" embed.color = 0x00ff00 channel.send({ embeds: [embed] })