ImoutoChan/GreenCaptchaBot

Bot will restrict the user who invited another one, and not the invited user

ForNeVeR opened this issue · 0 comments

Consider a case when a user invites another one into the chat. E.g. @user1 invites @user2 into the chat.

In such case, message.NewChatMembers will contain the @user2, while message.From.Id will contain @user1's identifier.

This code won't work properly for such case: it will try to restrict the @user1 instead of @user2:

await _telegramBot.RestrictChatMemberAsync(
message.Chat.Id,
message.From.Id,
DateTime.Now.AddDays(1),
false,
false,
false,
false);