ba0f3 / telebot.nim

Async Telegram Bot API Client implement in @Nim-Lang
MIT License
165 stars 24 forks source link

getChatMember doesn't show full information #36

Closed rupansh closed 5 years ago

rupansh commented 5 years ago

code-snippet-

   
proc canBotPromote*(b: TeleBot, m: Message): Future[bool] {.async.} =
    let bot = await b.getMe()
    let botChat = await getChatMember(b, intToStr(m.chat.id.int), bot.id)
    echo botChat
    if botChat.canPromoteMebers.isSome:
        return botChat.canPromoteMebers.get

Expect output: true Got output: false echo BotChat: (user: (id: 667777388, isBot: true, firstName: "BullyBot", lastName: None[string], username: Some("bullygodbot"), languageCode: None[string]), status: "administrator", untilDate: None[int], canBeEdited: Some(false), canChangeInfo: Some(true), canPostMessages: None[bool], canEditMessages: None[bool], canDeleteMessages: Some(true), canInviteUsers: Some(true), canRestrictMembers: Some(true), canPinMessages: Some(true), canPromoteMebers: None[bool], isMember: None[bool], canSendMessages: None[bool], canSendMediaMessages: None[bool], canSendOtherMessages: None[bool], canAddWebPagePreviews: None[bool])

Tested url - https://api.telegram.org/botsecret:secret/getChatMember?chat_id=-1001262378051&user_id=667777388 Got output: {"ok":true,"result":{"user":{"id":667777388,"is_bot":true,"first_name":"BullyBot","username":"bullygodbot"},"status":"administrator","can_be_edited":false,"can_change_info":true,"can_delete_messages":true,"can_invite_users":true,"can_restrict_members":true,"can_pin_messages":true,"can_promote_members":true}}

ba0f3 commented 5 years ago

there is a typo :(

rupansh commented 5 years ago

there is a typo :(

where ;_;