Compare commits

9 Commits

Author SHA1 Message Date
f37beb0a5d Removed try/catch it broke
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-15 10:05:30 -05:00
eec1050e17 Added datetime for logging 2023-02-15 10:05:14 -05:00
8ffd920007 Updated CMD command
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-14 15:29:55 -05:00
846b7d10d8 Fixed tag to be lowercase
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-14 15:17:53 -05:00
5adc9b7b9f Fixed image tag
Some checks failed
continuous-integration/drone/push Build is failing
2023-02-14 15:13:30 -05:00
3eb412bd6e Fixed missing step
Some checks failed
continuous-integration/drone/push Build is failing
2023-02-14 15:09:57 -05:00
1949c7af1b Merge branch 'main' of git.kizaing.ca:kizaing/TeleTok
Some checks reported errors
continuous-integration/drone/push Build encountered an error
continuous-integration/drone Build encountered an error
2023-02-14 15:07:27 -05:00
993a94ddb1 Updated build task 2023-02-14 15:06:39 -05:00
26dcd962b8 Merge pull request 'bugfixes/crash-handler' (#1) from bugfixes/crash-handler into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #1
2023-02-14 11:53:45 -08:00
4 changed files with 21 additions and 26 deletions

View File

@ -4,11 +4,6 @@ type: docker
name: publish-bot
steps:
- name: build-dotnet
image: mcr.microsoft.com/dotnet/sdk:6.0
commands:
- dotnet publish
- name: build-image
image: plugins/docker
settings:
@ -17,10 +12,8 @@ steps:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PASS
repo: git.kizaing.ca/kizaing/TeleTok
repo: git.kizaing.ca/kizaing/teletok
tags: latest
platform: linux/amd64,linux/arm64
# Commented out until stuff actually works
trigger:

View File

@ -1,7 +1,14 @@
FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine3
#Builds the bot from source
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-task
COPY . /build
RUN cd /build && dotnet publish
# Actually runs the bot
FROM mcr.microsoft.com/dotnet/runtime:6.0
WORKDIR /app/teletok
COPY bin/Debug/net6.0/publish/* /app/teletok/
COPY --from=build-task /build/bin/Debug/net6.0/publish/* /app/teletok/
CMD [ "TeleTok" ]
CMD [ "./TeleTok" ]

View File

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

View File

@ -12,13 +12,15 @@ namespace TeleTok
string url = videourl;
string proxyUrl;
DateTime now =DateTime.Now;
if(url.Contains("vm.tiktok.com"))
{
url = UnshortenUrl(url);
}
proxyUrl = TeleTok.ptInstance + "/download?url=" + url;
Console.WriteLine("Video for " + url + " has been sent..");
Console.WriteLine("[" + now.ToString() + "] " + "Video for " + url + " has been sent..");
return proxyUrl;
}