Fix error in USPS if package status update isn't available

This commit is contained in:
Dragon Fire
2020-03-30 14:35:20 -04:00
parent 1c272e3307
commit 120c73d897
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -34,13 +34,13 @@ module.exports = class USPSTrackingCommand extends Command {
async run(msg, { id }) {
try {
const { expected, summary } = await this.fetchStatus(id);
if (!summary) return msg.say('A status update is not yet available on your package. Check back soon.');
const data = await this.fetchStatus(id);
if (!data) return msg.say('A status update is not yet available on your package. Check back soon.');
return msg.say(stripIndents`
**Tracking info for ${id}:**
${summary}
${data.summary}
Expected Delivery by: ${expected || 'N/A'}
Expected Delivery by: ${data.expected || 'N/A'}
More Info: <https://tools.usps.com/go/TrackConfirmAction?tLabels=${id}>
`);
} catch (err) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "112.19.2",
"version": "112.19.3",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {