From 86b7d5837e0fe8d648b757a7f595b785c3e5bfa4 Mon Sep 17 00:00:00 2001 From: dowoge Date: Mon, 9 Oct 2023 14:39:53 -0400 Subject: [PATCH] remove debug prints + fix usernamehistory + onlinestatus erroring for terminated user --- src/modules/commands/user.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/commands/user.lua b/src/modules/commands/user.lua index bb75d8b..ca10bee 100644 --- a/src/modules/commands/user.lua +++ b/src/modules/commands/user.lua @@ -90,7 +90,7 @@ commands:Add('user',{},'user ', function(t) if type(user_info)=='string' then return message:reply('```'..user_info..'```') end local description = user_info.description=='' and 'This user has no description' or user_info.description - table.foreach(user_info,print) + -- table.foreach(user_info,print) local created = tostring(date.fromISO(user_info.created):toSeconds()) local current = date():toSeconds() local accountAge = round((current-created)/86400) @@ -99,15 +99,15 @@ commands:Add('user',{},'user ', function(t) local name = user_info.name local displayName = user_info.displayName - local usernameHistory = API:GetUserUsernameHistory(id).data + local usernameHistory = API:GetUserUsernameHistory(id).data or {} local usernameHistoryTable = {} for index,usernameObj in next,usernameHistory do table.insert(usernameHistoryTable,usernameObj.name) end local usernameHistoryString = table.concat(usernameHistoryTable,', ') - local onlineStatus_info = API:GetUserOnlineStatus(id) - table.foreach(onlineStatus_info,print) + local onlineStatus_info = API:GetUserOnlineStatus(id) or {lastLocation="Unknown", lastOnline=0, userPresenceType=-1} + -- table.foreach(onlineStatus_info,print) local LastLocation = onlineStatus_info.lastLocation if onlineStatus_info.userPresenceType==2 then LastLocation="Ingame" end