@@ -176,6 +176,7 @@ function Bot(token) {
176176
177177 this . forwardMessage = ( chat_id , from_chat_id , message_id , options ) => {
178178 if ( chat_id instanceof Chat ) chat_id = chat_id . id ;
179+ if ( chat_id instanceof User ) chat_id = chat_id . id ;
179180 options = options || { } ;
180181 options . chat_id = chat_id ;
181182 options . from_chat_id = from_chat_id ;
@@ -206,6 +207,7 @@ function Bot(token) {
206207
207208 this . sendFile = ( chat_id , type , path , options ) => {
208209 if ( chat_id instanceof Chat ) chat_id = chat_id . id ;
210+ if ( chat_id instanceof User ) chat_id = chat_id . id ;
209211 options = options || { } ;
210212 options . chat_id = chat_id ;
211213 var method ;
@@ -321,6 +323,7 @@ function Bot(token) {
321323
322324 this . getChatAdministrators = ( chat_id ) => {
323325 if ( chat_id instanceof Chat ) chat_id = chat_id . id ;
326+ if ( chat_id instanceof User ) chat_id = chat_id . id ;
324327 return this . call ( 'getChatAdministrators' , { chat_id : chat_id } ) . then ( ( res ) => {
325328 var administrators = res . body . result ;
326329 var processed = [ ] ;
@@ -356,13 +359,15 @@ function Bot(token) {
356359
357360 this . getChatMembersCount = ( chat_id ) => {
358361 if ( chat_id instanceof Chat ) chat_id = chat_id . id ;
362+ if ( chat_id instanceof User ) chat_id = chat_id . id ;
359363 return this . call ( 'getChatMembersCount' , { chat_id : chat_id } ) . then ( ( res ) => {
360364 return res . body . result ;
361365 } )
362366 } ;
363367
364368 this . sendChatAction = ( chat_id , action ) => {
365369 if ( chat_id instanceof Chat ) chat_id = chat_id . id ;
370+ if ( chat_id instanceof User ) chat_id = chat_id . id ;
366371 return this . call ( 'sendChatAction' , { chat_id : chat_id , action : action } ) . then ( ( res ) => {
367372 return res . body . result ;
368373 } )
0 commit comments