Added try catch for URL parsing
This commit is contained in:
		@@ -55,15 +55,22 @@ namespace TeleTok
 | 
			
		||||
            // Passes the url along to the video downloader if it is valid AND a tiktok link
 | 
			
		||||
            if (isUri)
 | 
			
		||||
            {
 | 
			
		||||
                if(messageText.Contains("tiktok.com"))
 | 
			
		||||
                try
 | 
			
		||||
                {
 | 
			
		||||
                    proxyUrl = VidDownload.TikTokURL(messageText);
 | 
			
		||||
                    if(messageText.Contains("tiktok.com"))
 | 
			
		||||
                    {
 | 
			
		||||
                        proxyUrl = VidDownload.TikTokURL(messageText);
 | 
			
		||||
 | 
			
		||||
                    Message ttVideo = await botClient.SendVideoAsync(
 | 
			
		||||
                        chatId: chatId,
 | 
			
		||||
                        video: proxyUrl,
 | 
			
		||||
                        cancellationToken: cancellationToken
 | 
			
		||||
                    );
 | 
			
		||||
                        Message ttVideo = await botClient.SendVideoAsync(
 | 
			
		||||
                            chatId: chatId,
 | 
			
		||||
                            video: proxyUrl,
 | 
			
		||||
                            cancellationToken: cancellationToken
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                catch 
 | 
			
		||||
                {
 | 
			
		||||
                    Console.WriteLine("Valid TikTok URI was sent, but was not a video!");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user