Open jenningszheng opened 1 year ago
anyone else can help? plz
same question
I share the same inquiry as well. With the removal of KickChatMember/BanChatMember, the latest version seems to lack clarity on how to kick/ban users.
In case someone is still facing the same problem, the solution is to use 'Request' instead of 'KickChatMember'. I hope this helps ;)
h.logger.Infof("Banning bot: %v", GetUsername(&user))
banChatMemberConfig := tgbotapi.BanChatMemberConfig{
ChatMemberConfig: tgbotapi.ChatMemberConfig{
ChatID: ctx.Chat.ID,
UserID: user.ID,
},
RevokeMessages: false,
}
h.bot.Request(banChatMemberConfig)
v5 documentation: https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api/v5#BotAPI v4.6.4 documentation: https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api#BotAPI.KickChatMember
why remove KickChatMember function from BotAPI in v5?