Kick mechanism change
This commit is contained in:
parent
7ecc73cbc3
commit
184055e2f8
@ -216,17 +216,17 @@ func (s *Squader) kickUserFromSquadChat(user *tgbotapi.User, chatRaw *dbmapping.
|
|||||||
UserID: user.ID,
|
UserID: user.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
allNo := false
|
kickConfig := tgbotapi.KickChatMemberConfig{
|
||||||
kickConfig := tgbotapi.RestrictChatMemberConfig{
|
|
||||||
ChatMemberConfig: chatUserConfig,
|
ChatMemberConfig: chatUserConfig,
|
||||||
UntilDate: 1893456000,
|
UntilDate: 1893456000,
|
||||||
CanSendMessages: &allNo,
|
|
||||||
CanSendMediaMessages: &allNo,
|
|
||||||
CanAddWebPagePreviews: &allNo,
|
|
||||||
CanSendOtherMessages: &allNo,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_, 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 {
|
if err != nil {
|
||||||
c.Log.Error(err.Error())
|
c.Log.Error(err.Error())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user