diff --git a/Sources/TelegramBotSDK/Extensions/Scanner+Compatibility.swift b/Sources/TelegramBotSDK/Extensions/Scanner+Compatibility.swift index 2b80033..a26da39 100644 --- a/Sources/TelegramBotSDK/Extensions/Scanner+Compatibility.swift +++ b/Sources/TelegramBotSDK/Extensions/Scanner+Compatibility.swift @@ -81,6 +81,9 @@ extension Scanner { #if os(Linux) || os(Windows) func scanUpTo(_ string: String) -> String? { + if string.isEmpty { + return scanUpToCharacters(from: CharacterSet()) + } return scanUpToString(string) } #elseif os(OSX)