mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-24 10:58:14 +00:00
src: Improve performance when matching message types
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.
This commit is contained in:
parent
772609c334
commit
ba4d207684
@ -20,6 +20,7 @@ const deprecate = require('depd')('node-telegram-bot-api');
|
|||||||
let Promise = require('bluebird');
|
let Promise = require('bluebird');
|
||||||
|
|
||||||
const _messageTypes = [
|
const _messageTypes = [
|
||||||
|
'text',
|
||||||
'audio',
|
'audio',
|
||||||
'channel_chat_created',
|
'channel_chat_created',
|
||||||
'contact',
|
'contact',
|
||||||
@ -40,7 +41,6 @@ const _messageTypes = [
|
|||||||
'sticker',
|
'sticker',
|
||||||
'successful_payment',
|
'successful_payment',
|
||||||
'supergroup_chat_created',
|
'supergroup_chat_created',
|
||||||
'text',
|
|
||||||
'video',
|
'video',
|
||||||
'video_note',
|
'video_note',
|
||||||
'voice',
|
'voice',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user