Skip to content

Commit

Permalink
fix: Context.replay arguments type.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-karpov committed Jul 18, 2018
1 parent 45d104c commit daba639
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/context.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { reversedInterpolation, selectCommand } = require('./utils')
import Session from './session'

import ReplyBuilder from './replyBuilder'
import ReplyBuilder, {IReply} from './replyBuilder'
import ButtonBuilder from './buttonBuilder'

import { WebhookResponse, WebhookRequest } from './types/webhook'
Expand Down Expand Up @@ -75,7 +75,7 @@ export default class Context implements IContext {
return reversedInterpolation(this.command.name, requestText)
}

public async reply(replyMessage: string | {}): Promise<WebhookResponse> {
public async reply(replyMessage: string | IReply): Promise<WebhookResponse> {
if (typeof replyMessage === 'undefined') {
throw new Error('Reply message could not be empty!')
}
Expand Down
2 changes: 1 addition & 1 deletion src/replyBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ALICE_PROTOCOL_VERSION,
} from './constants'

interface IReply {
export interface IReply {
response: {
text?: string,
tts?: string,
Expand Down
4 changes: 2 additions & 2 deletions src/types/context.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WebhookRequest, WebhookResponse } from './webhook'
import ReplyBuilder from '../replyBuilder'
import ReplyBuilder, {IReply} from '../replyBuilder'
import ButtonBuilder from '../buttonBuilder'
import { EventEmitterInterface } from './eventEmitter'

Expand All @@ -18,7 +18,7 @@ export interface IContext {
replyBuilder: ReplyBuilder
buttonBuilder: ButtonBuilder

reply: (replyMessage: string | {}) => Promise<WebhookResponse>
reply: (replyMessage: string | IReply) => Promise<WebhookResponse>
sendResponse: (response: WebhookResponse) => void
enterScene: (sceneName: string) => void
leaveScene: () => void
Expand Down

0 comments on commit daba639

Please sign in to comment.