PaulSonOfLars/gotgbot

Creater doesn't has admin permissions

Roker2 opened this issue · 2 comments

Hi! Bot think, that creater doesn't have permissions, but he has it!
For example, I tested CanRestrictMembers. Bot said false for creater. Bot said true for other admins.

func test(b ext.Bot, u *gotgbot.Update) error {
	member, err := u.Message.Chat.GetMember(u.Message.From.Id)
	_, err = b.SendMessage(u.Message.Chat.Id, strconv.FormatBool(member.CanRestrictMembers))
	return err
}

This is an issue with the telegram bot api, and not the library. For some reason, telegram have decided that if a member is the creator, they will not populate those fields.
You should check member.Status if the user is the creator.
https://core.telegram.org/bots/api#chatmember

Okay, thank you!