From 816fcad07d296a9f9fa67240848401bf4acc4b02 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 25 Apr 2021 23:03:59 -0400 Subject: [PATCH] Fix timezone error --- package.json | 2 +- types/timezone.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 17259da6..8ac849ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "137.0.2", + "version": "137.0.3", "description": "Your personal server companion.", "main": "Xiao.js", "private": true, diff --git a/types/timezone.js b/types/timezone.js index 834d1076..49484427 100644 --- a/types/timezone.js +++ b/types/timezone.js @@ -15,9 +15,9 @@ module.exports = class TimezoneType extends ArgumentType { new ZipToTz().full(value); return true; } catch { - const cityZone = cityTimezones.lookupViaCity(value); + const cityZone = cityTimezones.lookupViaCity(value).filter(res => res.timezone); if (cityZone.length) return true; - const provZone = cityTimezones.findFromCityStateProvince(value); + const provZone = cityTimezones.findFromCityStateProvince(value).filter(res => res.timezone); if (provZone.length) return true; } return false; @@ -30,9 +30,9 @@ module.exports = class TimezoneType extends ArgumentType { const zipZone = new ZipToTz().full(value); return zipZone; } catch { - const cityZone = cityTimezones.lookupViaCity(value); + const cityZone = cityTimezones.lookupViaCity(value).filter(res => res.timezone); if (cityZone.length) return cityZone[0].timezone; - const provZone = cityTimezones.findFromCityStateProvince(value); + const provZone = cityTimezones.findFromCityStateProvince(value).filter(res => res.timezone); if (provZone.length) return provZone[0].timezone; } return null;