chr233 / ASFEnhance

ASF 扩展命令插件 / External commands for ASF
GNU Affero General Public License v3.0
497 stars 41 forks source link

[Bug] SETAVATAR broken #112

Closed nuckle closed 1 year ago

nuckle commented 1 year ago

Describe the bug

Can't set bot's avatar using SETAVATAR command. Commands like RANDOMGAMEAVATAR work fine

Error Log

ASFenhance encountered error, error logs below
==========================================
 - Origin Message: SETAVATAR bot https://example.com/image.jpg
 - Access: Owner
 - ASF Version: 5.4.5.2
 - Plugin Version: 1.8.1.1
==========================================
{
  "EULA": true,
  "Statistic": true,
  "DevFeature": false,
  "DisabledCmds": [],
  "Address": null,
  "Addresses": []
}
==========================================
 - Exception Type: System.MissingMethodException
 - Exception Message: Method not found: 'Void System.Net.Http.MultipartFormDataContent.Add(System.Net.Http.HttpContent, System.String, System.String)'.
   at ASFEnhance.Profile.WebRequest.ApplyCustomAvatar(Bot bot, String imgUrl)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine&)
   at ASFEnhance.Profile.WebRequest.ApplyCustomAvatar(Bot bot, String imgUrl)
   at ASFEnhance.Profile.Command.ResponseSetProfileAvatar(Bot bot, String imgUrl)
   at ArchiSteamFarm.Core.Utilities.InParallel[T](IEnumerable`1 tasks)
   at ASFEnhance.Profile.Command.ResponseSetProfileAvatar(String botNames, String imgUrl)
   at ASFEnhance.ASFEnhance.ResponseCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamId)
   at ASFEnhance.ASFEnhance.OnBotCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamId)
chr233 commented 1 year ago

fixed, but only works in ASF-generic build (not ASF-generic-netf build), in normal build, the dependency of system.net.http is broken in normal build.

check https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Plugins#plugin-dependencies

nuckle commented 1 year ago

I installed ASF-generic, but it seems like the command still doesn't work. It looks fine, but nothing actually happens and avatar still the same. DELETEAVATAR also doesn't reset account's avatar.

sea bot https://example.com/image.jpg
<bot> Set avatar success

Logs:

2023-06-01 10:55:09|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 1
2023-06-01 10:55:09|dotnet-16013|DEBUG|bot|InternalRequest() GET https://example.com/image.jpg
2023-06-01 10:55:10|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 2
2023-06-01 10:55:10|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 3
2023-06-01 10:55:10|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 4
2023-06-01 10:55:10|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 5
2023-06-01 10:55:10|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 6
2023-06-01 10:55:10|dotnet-16013|DEBUG|bot|InternalRequest() POST https://steamcommunity.com/actions/FileUploader/
2023-06-01 10:55:11|dotnet-16013|DEBUG|bot|InternalRequest() OK <- POST https://steamcommunity.com/actions/FileUploader/
chr233 commented 1 year ago

you need to provide a valid image url such as https://i0.hdslb.com/bfs/article/07112584c769115367876cab0d3a87f7a2892a78.jpg instead of https://example.com/image.jpg

nuckle commented 1 year ago

It's just an example url. I tried several websites and nothing happens. With your url I got this:

sea bot https://i0.hdslb.com/bfs/article/07112584c769115367876cab0d3a87f7a2892a78.jpg
<bot> Set avatar success
2023-06-01 13:56:13|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 1
2023-06-01 13:56:13|dotnet-16013|DEBUG|bot|InternalRequest() GET https://i0.hdslb.com/bfs/article/07112584c769115367876cab0d3a87f7a2892a78.jpg
2023-06-01 13:56:14|dotnet-16013|DEBUG|bot|InternalRequest() OK <- GET https://i0.hdslb.com/bfs/article/07112584c769115367876cab0d3a87f7a2892a78.jpg
2023-06-01 13:56:14|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 2
2023-06-01 13:56:14|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 3
2023-06-01 13:56:14|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 4
2023-06-01 13:56:14|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 5
2023-06-01 13:56:14|dotnet-16013|INFO|ASF|ApplyCustomAvatar() 6
2023-06-01 13:56:14|dotnet-16013|DEBUG|bot|InternalRequest() POST https://steamcommunity.com/actions/FileUploader/
2023-06-01 13:56:15|dotnet-16013|DEBUG|bot|InternalRequest() OK <- POST https://steamcommunity.com/actions/FileUploader/
chr233 commented 1 year ago

I see, working on it.

chr233 commented 1 year ago

1.8.1.3 will fix this issue, wait until build complete