Skip to content

Commit

Permalink
fixes #9 bot response language
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewberryman committed Jul 17, 2018
1 parent 7692dfe commit d552d57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/telegram.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ export default class Telegram {
**/
sendReply(telegramMessage) {
return new Promise((resolve, reject) => {
const properties = {
let properties = {
userId: String(telegramMessage.chat.id),
language: this.config.DEFAULT_LANGUAGE,
network: 'telegram',
};
if (this._classify(telegramMessage.text) === 'flood') {
properties.language = 'en'; // user speaks English
this.bot.card(properties)
.then((msg) => {
const response = this._prepareLinkResponse(properties.userId, msg);
Expand Down

0 comments on commit d552d57

Please sign in to comment.