Skip to content

Commit

Permalink
handle help
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkyJie committed Apr 17, 2018
1 parent 9099b10 commit a8e4406
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion functions/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getRepoParagraph, getRandomMessage, getRepoStartMessage } from './utils

const ACTIONS = {
WELCOME: 'input.welcome',
HELP: 'help',
FETCH_TRENDING: 'fetch_trending',
FETCH_TRENDING_NEXT_YES: 'fetch_trending.fetch_trending-yes',
FETCH_TRENDING_NEXT_NO: 'fetch_trending.fetch_trending-no',
Expand All @@ -20,7 +21,6 @@ const CONTEXTS = {
FETCH_TRENDING_FOLLOWUP: 'fetch_trending-followup',
};


export default class GithubBot {
app: DialogflowApp;
data: UserData;
Expand Down Expand Up @@ -52,6 +52,15 @@ export default class GithubBot {
this.app.ask(getRandomMessage(PROMPTS.WELCOME_MESSAGE), PROMPTS.NO_INPUT_WELCOME);
}

[ACTIONS.HELP] () {
this.app.ask([
'<speak>',
PROMPTS.HELP,
PROMPTS.COMMAND_INTRODUCE,
'</speak>'
].join('<break />'));
}

[ACTIONS.FETCH_TRENDING] () {
const { language, repositories } = this.data;
const arg = this.app.getArgument(PARAMETERS.LANGUAGE);
Expand Down

0 comments on commit a8e4406

Please sign in to comment.