mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
Fix error in USPS if package status update isn't available
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "112.19.2",
|
||||
"version": "112.19.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user