This commit is contained in:
Christopher Cookman 2024-07-22 12:43:45 -06:00
parent 8eb154decb
commit 9bdbebd20f
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

105
index.js
View file

@ -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: `<t:${new Date(thisBan.banned_timestamp) / 1000}:f> <t:${new Date(thisBan.banned_timestamp) / 1000}:R>`,
inline: true
},
{
name: "Expires",
value: `<t:${new Date(thisBan.expires) / 1000}:f> <t:${new Date(thisBan.expires) / 1000}:R>`,
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: `<t:${new Date(thisBan.banned_timestamp) / 1000}:f> <t:${new Date(thisBan.banned_timestamp) / 1000}:R>`,
inline: true
},
{
name: "Expires",
value: `<t:${new Date(thisBan.expires) / 1000}:f> <t:${new Date(thisBan.expires) / 1000}:R>`,
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: `<t:${new Date(thisBan.banned_timestamp) / 1000}:f> <t:${new Date(thisBan.banned_timestamp) / 1000}:R>`,
inline: true
},
{
name: "Expires",
value: `<t:${new Date(thisBan.expires) / 1000}:f> <t:${new Date(thisBan.expires) / 1000}:R>`,
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] })