Skip to content

Commit

Permalink
ban by userId
Browse files Browse the repository at this point in the history
  • Loading branch information
Szer committed Sep 26, 2023
1 parent 45383f4 commit 0d63db6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/VahterBanBot/Bot.fs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let banInAllChats (botConfig: BotConfiguration) (botClient: ITelegramBotClient)
|> Seq.map (fun (KeyValue(chatUserName, chatId)) -> task {
// ban user in each chat
try
do! botClient.BanChatMemberAsync(ChatId chatUserName, targetUserId, DateTime.UtcNow.AddMonths 13)
do! botClient.BanChatMemberAsync(ChatId chatId, targetUserId, DateTime.UtcNow.AddMonths 13)
return Ok(chatUserName, chatId)
with e ->
return Error (chatUserName, chatId, e)
Expand Down Expand Up @@ -127,3 +127,4 @@ let onUpdate
let! _ = botClient.SendTextMessageAsync(ChatId(message.Chat.Id), "pong")
()
}

0 comments on commit 0d63db6

Please sign in to comment.