Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasholderness committed Jul 10, 2018
1 parent 7149455 commit 6253920
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/functions/receive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export default async (event, context, callback) => {
const payload = await Joi.validate(event.body, _bodySchema);
// Reply to Telegram directly to stop duplicate messages
handleResponse(callback, 200, {});
console.log('response sent');
// Class
const telegram = new Telegram(config);
console.log('class made');
// Send reply message
await telegram.sendReply(payload.message);
console.log('Message sent');
Expand Down
2 changes: 2 additions & 0 deletions src/lib/telegram.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ export default class Telegram {
network: 'telegram',
};
if (this._classify(telegramMessage.text) === 'flood') {
console.log('this is a flood message');
this.bot.card(properties)
.then((msg) => {
const response = this._prepareLinkResponse(properties.userId, msg);
console.log('response', response);
resolve(this._sendMessage(response));
}).catch((err) => reject(err));
} else {
Expand Down

0 comments on commit 6253920

Please sign in to comment.