Weird fix to a weird problem

This commit is contained in:
Christopher Cookman 2024-07-22 12:41:33 -06:00
parent ceb797da81
commit f5787cb105
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

111
index.js
View file

@ -96,44 +96,45 @@ client.on('ready', async () => {
const sendMessages = async (data) => { const sendMessages = async (data) => {
const channel = await client.channels.fetch(process.env.DISCORD_BANLOG_CHANNEL_ID); const channel = await client.channels.fetch(process.env.DISCORD_BANLOG_CHANNEL_ID);
console.log(data) console.log(data)
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) { for (const ban in data.added) {
thisBan = data.added[ban] thisBan = data.added[ban]
embed = { embed.title = "Ban Added"
title: "Ban Added", embed.color = 0xff0000
color: 0xff0000,
fields: [
{
name: "Banned Username",
value: thisBan.banned_username,
inline: true
},
{
name: "Banned ID",
value: thisBan.banned_id,
inline: true
},
{
name: "Banned",
value: `<t:${thisBan.banned_timestamp / 1000}:f> <t:${thisBan.banned_timestamp / 1000}:R>`,
inline: true
},
{
name: "Expires",
value: `<t:${thisBan.expires / 1000}:f> <t:${thisBan.expires / 1000}:R>`,
inline: true
},
{
name: "Reason",
value: thisBan.reason,
inline: true
},
{
name: "Moderator",
value: thisBan.moderator,
inline: true
}
]
}
console.log(embed) console.log(embed)
channel.send({ embeds: [embed] }) channel.send({ embeds: [embed] })
} }
@ -141,42 +142,8 @@ const sendMessages = async (data) => {
for (const ban in data.removed) { for (const ban in data.removed) {
thisBan = data.removed[ban] thisBan = data.removed[ban]
embed = { embed.title = "Ban Removed"
title: "Ban Removed", embed.color = 0x00ff00
color: 0x00ff00,
fields: [
{
name: "Banned Username",
value: thisBan.banned_username,
inline: true
},
{
name: "Banned ID",
value: thisBan.banned_id,
inline: true
},
{
name: "Banned",
value: `<t:${thisBan.banned_timestamp / 1000}:f> <t:${thisBan.banned_timestamp / 1000}:R>`,
inline: true
},
{
name: "Expires",
value: `<t:${thisBan.expires / 1000}:f> <t:${thisBan.expires / 1000}:R>`,
inline: true
},
{
name: "Reason",
value: thisBan.reason,
inline: true
},
{
name: "Moderator",
value: thisBan.moderator,
inline: true
}
]
}
console.log(embed) console.log(embed)
channel.send({ embeds: [embed] }) channel.send({ embeds: [embed] })
}; };