Merge pull request 'bugfixes/crash-handler' (#1) from bugfixes/crash-handler into main
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone/push Build is failing
				
			Reviewed-on: #1
This commit is contained in:
		
							
								
								
									
										32
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								.drone.yml
									
									
									
									
									
								
							@@ -1,24 +1,30 @@
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
type: docker
 | 
			
		||||
name: build-app
 | 
			
		||||
name: publish-bot
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
- name: build-dotnet
 | 
			
		||||
  image: mcr.microsoft.com/dotnet/sdk:6.0
 | 
			
		||||
  commands:
 | 
			
		||||
  - dotnet build
 | 
			
		||||
  - dotnet publish
 | 
			
		||||
 | 
			
		||||
- name: build-image
 | 
			
		||||
  image: plugins/docker
 | 
			
		||||
  settings:
 | 
			
		||||
    registry: git.kizaing.ca
 | 
			
		||||
    username:
 | 
			
		||||
      from_secret: DOCKER_USER
 | 
			
		||||
    password:
 | 
			
		||||
      from_secret: DOCKER_PASS
 | 
			
		||||
    repo: git.kizaing.ca/kizaing/TeleTok
 | 
			
		||||
    tags: latest
 | 
			
		||||
    platform: linux/amd64,linux/arm64
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
- name: build-docker
 | 
			
		||||
  image: docker:dind
 | 
			
		||||
  volumes:
 | 
			
		||||
  - name: dockersock
 | 
			
		||||
    path: /var/run/docker.sock
 | 
			
		||||
 | 
			
		||||
# Commented out until stuff actually works
 | 
			
		||||
#trigger:
 | 
			
		||||
#  branch:
 | 
			
		||||
#  - main
 | 
			
		||||
#  event:
 | 
			
		||||
#  - push
 | 
			
		||||
trigger:
 | 
			
		||||
  branch:
 | 
			
		||||
  - main
 | 
			
		||||
  event:
 | 
			
		||||
  - push
 | 
			
		||||
@@ -2,10 +2,6 @@ FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine3
 | 
			
		||||
 | 
			
		||||
WORKDIR /app/teletok
 | 
			
		||||
 | 
			
		||||
RUN apk update && apk add --update nodejs nodejs-npm 
 | 
			
		||||
 | 
			
		||||
RUN npm i -g tiktok-scraper
 | 
			
		||||
 | 
			
		||||
COPY bin/Debug/net6.0/* /app/teletok/
 | 
			
		||||
COPY bin/Debug/net6.0/publish/* /app/teletok/
 | 
			
		||||
 | 
			
		||||
CMD [ "TeleTok" ]
 | 
			
		||||
@@ -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