From 133cb7e73e426c8406587e166383adfa60e6298d Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sun, 1 Apr 2018 22:28:46 +0200 Subject: [PATCH] make shorthands work with >1 words :bug: --- commands/departures/index.js | 6 +++--- commands/journeys/index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/departures/index.js b/commands/departures/index.js index 96a2c64..16c7ab9 100644 --- a/commands/departures/index.js +++ b/commands/departures/index.js @@ -55,9 +55,9 @@ const printDeps = async (allDeps, ctx) => { } const departures = async (ctx, next) => { - // `/a spichernstr` shorthand - if (ctx.args && ctx.args[0]) { - const station = await parseWhere(ctx.args[0], ctx) + // `/a u spichernstr` shorthand + if (ctx.args && ctx.args.length > 0) { + const station = await parseWhere(ctx.args.join(' '), ctx) if (station) await ctx.storage.putData('where', station) return next() } diff --git a/commands/journeys/index.js b/commands/journeys/index.js index a721abc..b2ca98c 100644 --- a/commands/journeys/index.js +++ b/commands/journeys/index.js @@ -68,9 +68,9 @@ const getFrequentStationKeys = async (ctx) => { const journeys = async (ctx, next) => { ctx.freqStationKeys = await getFrequentStationKeys(ctx) - // `/a spichernstr` shorthand - if (ctx.args && ctx.args[0]) { - const origin = await parseWhere(ctx.args[0], ctx) + // `/j u spichernstr` shorthand + if (ctx.args && ctx.args.length > 0) { + const origin = await parseWhere(ctx.args.join(' '), ctx) if (origin) await ctx.storage.putData('origin', origin) return next() }