Scordo / TS3QueryLib.Net

This library allows you to query team speak 3 servers using the query port. All queries are implemented type safe and the library is written to work with .Net 3.5 SP1 or higher inluding support for silverlight 3.0 or higher and windows phone 7.1.
BSD 3-Clause "New" or "Revised" License
51 stars 15 forks source link

Get User's Avatar #26

Closed Pandry closed 7 years ago

Pandry commented 7 years ago

Hi, is it possible to download a user's avatar using the API?

Scordo commented 7 years ago

If it is possible to download it using the telnet commands, then its possible with this api. This api is just a wrapper arround the official telnet api.

Pandry commented 7 years ago

Okay, so it's not an integrated function... I'll try to do something and I hope to be able to do a pull request to add this feature :)

Scordo commented 7 years ago

You can get the filename of the users avatar this way:

And then you can just download it using the Method "DownloadFile" of SyncFileTransfer or AsyncFileTransfer class.

Pandry commented 7 years ago

Okay, I have a problem with the DownloadFile Method... I don't actually know how to call the method... I did try using the InitializeFileDownload function but I don't actually know how to download the image itself...

Pandry commented 7 years ago

Okay, I'm a dumbass, thank you so much :)

For everyone else who want to download it, here's how I did: InitializeFileDownloadResponse test = queryRunner.InitializeFileDownload(((uint)new Random().Next(1, 65535)), filename, 0, 0); SyncFileTransfer.DownloadFile(test.FileTransferKey, test.FileSize.GetValueOrDefault(), targetHost, targetFileTransferPort, fileLocation);