Add online status to lookup/details

This commit is contained in:
Lawin0129
2023-05-04 19:52:13 +01:00
parent 3898033bf5
commit 15a416badd
4 changed files with 11 additions and 5 deletions
+4 -1
View File
@@ -12,12 +12,15 @@ module.exports = {
const user = await User.findOne({ discordId: interaction.user.id }).lean();
if (!user) return interaction.editReply({ content: "You do not have a registered account!", ephemeral: true });
let onlineStatus = global.Clients.some(i => i.accountId == user.accountId);
let embed = new MessageEmbed()
.setColor("#56ff00")
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() })
.setFields(
{ name: "Created", value: `${new Date(user.created)}`.substring(0, 15) },
{ name: "Banned?", value: `${user.banned}` },
{ name: "Online", value: `${onlineStatus ? "Yes" : "No"}` },
{ name: "Banned", value: `${user.banned ? "Yes" : "No"}` },
{ name: "Account ID", value: user.accountId },
{ name: 'Username', value: user.username },
{ name: 'Email', value: `||${user.email}||` }
+4 -1
View File
@@ -22,13 +22,16 @@ module.exports = {
const user = await User.findOne({ username_lower: (options.get("username").value).toLowerCase() }).lean();
if (!user) return interaction.editReply({ content: "The account username you entered does not exist.", ephemeral: true });
let onlineStatus = global.Clients.some(i => i.accountId == user.accountId);
let embed = new MessageEmbed()
.setColor("#56ff00")
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() })
.setFields(
{ name: "Discord", value: `<@${user.discordId}>` },
{ name: "Created", value: `${new Date(user.created)}`.substring(0, 15) },
{ name: "Banned?", value: `${user.banned}` },
{ name: "Online", value: `${onlineStatus ? "Yes" : "No"}` },
{ name: "Banned", value: `${user.banned ? "Yes" : "No"}` },
{ name: 'Username', value: user.username }
)
.setTimestamp()
+1 -1
View File
@@ -135,7 +135,7 @@ app.post("/account/api/oauth/token", async (req, res) => {
if (req.user.banned) return error.createError(
"errors.com.epicgames.account.account_not_active",
"Sorry, your account is inactive and may not login.",
"You have been permanently banned from Fortnite.",
[], -1, undefined, 400, res
);
+2 -2
View File
@@ -23,7 +23,7 @@ async function verifyToken(req, res, next) {
if (req.user.banned) return error.createError(
"errors.com.epicgames.account.account_not_active",
"Sorry, your account is inactive and may not login.",
"You have been permanently banned from Fortnite.",
[], -1, undefined, 400, res
);
@@ -59,7 +59,7 @@ async function verifyClient(req, res, next) {
if (req.user.banned) return error.createError(
"errors.com.epicgames.account.account_not_active",
"Sorry, your account is inactive and may not login.",
"You have been permanently banned from Fortnite.",
[], -1, undefined, 400, res
);
}