Closed rupansh closed 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])
true
false
(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}}
https://api.telegram.org/botsecret:secret/getChatMember?chat_id=-1001262378051&user_id=667777388
{"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}}
there is a typo :(
where ;_;
code-snippet-
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}}