Skip to content

Commit

Permalink
src: Improve performance when matching message types
Browse files Browse the repository at this point in the history
Feature:

  Considering that the most encountered message type is (probably) 'text',
  we should match it as soon as possible; without wasting much time
  looping through less-likely-to-matched types.
  • Loading branch information
GochoMugo committed Nov 18, 2017
1 parent 772609c commit ba4d207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/telegram.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const deprecate = require('depd')('node-telegram-bot-api');
let Promise = require('bluebird');

const _messageTypes = [
'text',
'audio',
'channel_chat_created',
'contact',
Expand All @@ -40,7 +41,6 @@ const _messageTypes = [
'sticker',
'successful_payment',
'supergroup_chat_created',
'text',
'video',
'video_note',
'voice',
Expand Down

0 comments on commit ba4d207

Please sign in to comment.