From 184055e2f84b2d70907d51043ff9604ec6cf5242 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Wed, 29 Nov 2017 12:12:34 +0400 Subject: [PATCH] Kick mechanism change --- lib/squader/squader.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/squader/squader.go b/lib/squader/squader.go index 37be823..15d3371 100644 --- a/lib/squader/squader.go +++ b/lib/squader/squader.go @@ -216,17 +216,17 @@ func (s *Squader) kickUserFromSquadChat(user *tgbotapi.User, chatRaw *dbmapping. UserID: user.ID, } - allNo := false - kickConfig := tgbotapi.RestrictChatMemberConfig{ - ChatMemberConfig: chatUserConfig, - UntilDate: 1893456000, - CanSendMessages: &allNo, - CanSendMediaMessages: &allNo, - CanAddWebPagePreviews: &allNo, - CanSendOtherMessages: &allNo, + kickConfig := tgbotapi.KickChatMemberConfig{ + ChatMemberConfig: chatUserConfig, + UntilDate: 1893456000, } - _, err := c.Bot.RestrictChatMember(kickConfig) + _, err := c.Bot.KickChatMember(kickConfig) + if err != nil { + c.Log.Error(err.Error()) + } + + _, err = c.Bot.UnbanChatMember(chatUserConfig) if err != nil { c.Log.Error(err.Error()) }