mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
Program_SecretChats timerstamp name for saved media
This commit is contained in:
parent
b9587e3997
commit
d916342f1c
2
.github/dev.yml
vendored
2
.github/dev.yml
vendored
|
|
@ -2,7 +2,7 @@ pr: none
|
|||
trigger:
|
||||
- master
|
||||
|
||||
name: 3.0.1-dev.$(Rev:r)
|
||||
name: 3.0.2-dev.$(Rev:r)
|
||||
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ Type a command, or a message to send to the active secret chat:");
|
|||
if (msg.Media != null && unem.message is EncryptedMessage { file: EncryptedFile ef })
|
||||
{
|
||||
int slash = msg.Media.MimeType?.IndexOf('/') ?? 0; // quick & dirty conversion from MIME type to file extension
|
||||
var filename = slash > 0 ? $"media.{msg.Media.MimeType[(slash + 1)..]}" : "media.bin";
|
||||
var filename = $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.{(slash > 0 ? msg.Media.MimeType[(slash + 1)..] : "bin")}";
|
||||
Console.WriteLine($"{unem.message.ChatId}> {msg.Message} [attached file downloaded to {filename}]");
|
||||
using var output = File.Create(filename);
|
||||
await Secrets.DownloadFile(ef, msg.Media, output);
|
||||
|
|
|
|||
Loading…
Reference in a new issue