-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict' | ||
|
||
const commandsKeyboard = require('../lib/commands-keyboard') | ||
|
||
const departures = async (ctx, next) => { | ||
await ctx.replyWithMarkdown('`departures` command', commandsKeyboard) | ||
// todo | ||
next() | ||
} | ||
|
||
module.exports = departures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict' | ||
|
||
const commandsKeyboard = require('../lib/commands-keyboard') | ||
|
||
const text = `\ | ||
*This bot lets you use public transport in Berlin more easily.* You can do this: | ||
\`/a(bfahrt)\` – Show departures at a station. | ||
\`/r(oute)\` – Get routes from A to B. | ||
\`/n(earby)\` – Show stations around. | ||
When specifying time, you can use the following formats: | ||
- \`now\` | ||
- \`in 10min\` | ||
- \`tomorrow 17:20\` | ||
- \`8 pm\` | ||
- \`tuesday at 6\` | ||
The data behind this bot is from VBB, so departures & routing will be just as (in)accurate as in the BVG & VBB apps.` | ||
|
||
const help = async (ctx, next) => { | ||
await ctx.replyWithMarkdown(text, commandsKeyboard) | ||
next() | ||
} | ||
|
||
module.exports = help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict' | ||
|
||
const commandsKeyboard = require('../lib/commands-keyboard') | ||
|
||
const journeys = async (ctx, next) => { | ||
await ctx.replyWithMarkdown('`journeys` command', commandsKeyboard) | ||
// todo | ||
next() | ||
} | ||
|
||
module.exports = journeys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict' | ||
|
||
const commandsKeyboard = require('../lib/commands-keyboard') | ||
|
||
const nearby = async (ctx, next) => { | ||
await ctx.replyWithMarkdown('`nearby` command', commandsKeyboard) | ||
// todo | ||
next() | ||
} | ||
|
||
module.exports = nearby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict' | ||
|
||
const Markup = require('telegraf/markup') | ||
|
||
const keys = [ | ||
['/a', 'Show departures at a station.'].join('\u2063 '), | ||
['/r', 'Get routes from A to B.'].join('\u2063 '), | ||
['/n', 'Show stations around your location.'].join('\u2063 ') | ||
] | ||
|
||
const commandsKeyboard = Markup.keyboard(keys).oneTime().extra() | ||
|
||
module.exports = commandsKeyboard |