From 424d1b4a1d0d48e61582185c7d36205890aa9bd4 Mon Sep 17 00:00:00 2001 From: Chr_ Date: Wed, 23 Nov 2022 19:27:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug=E4=BF=AE=E6=AD=A3=20feat=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=91=BD=E4=BB=A4=E5=8F=82=E6=95=B0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ASFEnhance/ASFEnhance.cs | 6 +-- ASFEnhance/AssemblyInfo.cs | 4 +- ASFEnhance/Localization/Langs.Designer.cs | 2 +- ASFEnhance/Localization/Langs.en-US.resx | 2 +- ASFEnhance/Localization/Langs.resx | 2 +- ASFEnhance/Localization/Langs.zh-Hans.resx | 2 +- ASFEnhance/Other/Command.cs | 24 +++++------- ASFEnhance/Utils.cs | 2 +- SetSpecialProfile.py | 44 ---------------------- 9 files changed, 19 insertions(+), 69 deletions(-) delete mode 100644 SetSpecialProfile.py diff --git a/ASFEnhance/ASFEnhance.cs b/ASFEnhance/ASFEnhance.cs index 98cb794b..7381453c 100644 --- a/ASFEnhance/ASFEnhance.cs +++ b/ASFEnhance/ASFEnhance.cs @@ -21,7 +21,7 @@ internal sealed class ASFEnhance : IASF, IBotCommand2 public Version Version => MyVersion; [JsonProperty] - public static PluginConfig Config { get; internal set; } + public static PluginConfig Config => Utils.Config; /// /// ASF启动事件 @@ -32,7 +32,7 @@ public Task OnASFInit(IReadOnlyDictionary? additionalConfigPrope { if (additionalConfigProperties == null) { - Config = new(); + Utils.Config = new(); return Task.CompletedTask; } @@ -67,7 +67,7 @@ public Task OnASFInit(IReadOnlyDictionary? additionalConfigPrope } } - Config = config ?? new(); + Utils.Config = config ?? new(); if (Config.DevFeature) { diff --git a/ASFEnhance/AssemblyInfo.cs b/ASFEnhance/AssemblyInfo.cs index 1df2339d..f037f771 100644 --- a/ASFEnhance/AssemblyInfo.cs +++ b/ASFEnhance/AssemblyInfo.cs @@ -1,8 +1,8 @@ using System.Reflection; [assembly: CLSCompliant(false)] -[assembly: AssemblyVersion("1.6.19.4")] -[assembly: AssemblyFileVersion("1.6.19.4")] +[assembly: AssemblyVersion("1.6.20.0")] +[assembly: AssemblyFileVersion("1.6.20.0")] [assembly: AssemblyCopyright("Copyright © 2022 Chr_")] [assembly: AssemblyProduct("ASFEnhance")] diff --git a/ASFEnhance/Localization/Langs.Designer.cs b/ASFEnhance/Localization/Langs.Designer.cs index 2c996fe2..3a8921cb 100644 --- a/ASFEnhance/Localization/Langs.Designer.cs +++ b/ASFEnhance/Localization/Langs.Designer.cs @@ -700,7 +700,7 @@ internal static string CommandHelpNoUsage { } /// - /// 查找类似 - {0} / {1} {2} : {3} 的本地化字符串。 + /// 查找类似 * 可用缩写 : {0} 的本地化字符串。 /// internal static string CommandHelpWithShortName { get { diff --git a/ASFEnhance/Localization/Langs.en-US.resx b/ASFEnhance/Localization/Langs.en-US.resx index 550c4e43..a7852d9e 100644 --- a/ASFEnhance/Localization/Langs.en-US.resx +++ b/ASFEnhance/Localization/Langs.en-US.resx @@ -574,7 +574,7 @@ The plugin is up to date, no need to update - - {0} / {1} {2} : {3} + * Avilable shortcut: {0} - {0} {1} : {2} diff --git a/ASFEnhance/Localization/Langs.resx b/ASFEnhance/Localization/Langs.resx index 9d545575..29ae96d2 100644 --- a/ASFEnhance/Localization/Langs.resx +++ b/ASFEnhance/Localization/Langs.resx @@ -577,7 +577,7 @@ - {0} {1} : {2} - - {0} / {1} {2} : {3} + * 可用缩写 : {0} 找不到相关命令的帮助 diff --git a/ASFEnhance/Localization/Langs.zh-Hans.resx b/ASFEnhance/Localization/Langs.zh-Hans.resx index 450705a5..7ce92244 100644 --- a/ASFEnhance/Localization/Langs.zh-Hans.resx +++ b/ASFEnhance/Localization/Langs.zh-Hans.resx @@ -574,7 +574,7 @@ 当前已经是最新版本, 无需更新插件 - - {0} / {1} {2} : {3} + * 可用缩写 : {0} - {0} {1} : {2} diff --git a/ASFEnhance/Other/Command.cs b/ASFEnhance/Other/Command.cs index ae19b7d0..937e96fe 100644 --- a/ASFEnhance/Other/Command.cs +++ b/ASFEnhance/Other/Command.cs @@ -50,14 +50,12 @@ internal static class Command { usage = Langs.CommandHelpNoUsage; } + + sb.AppendLine(string.Format(Langs.CommandHelpNoShortName, cmd, args, usage)); if (CommandHelpData.FullCmd2ShortCmd.ContainsKey(cmd)) { string shortCmd = CommandHelpData.FullCmd2ShortCmd[cmd]; - sb.AppendLine(string.Format(Langs.CommandHelpWithShortName, cmd, shortCmd, args, usage)); - } - else - { - sb.AppendLine(string.Format(Langs.CommandHelpNoShortName, cmd, args, usage)); + sb.AppendLine(string.Format(Langs.CommandHelpWithShortName, shortCmd)); } } @@ -105,14 +103,11 @@ internal static class Command usage = Langs.CommandHelpNoUsage; } + sb.AppendLine(string.Format(Langs.CommandHelpNoShortName, cmd, args, usage)); if (CommandHelpData.FullCmd2ShortCmd.ContainsKey(cmd)) { string shortCmd = CommandHelpData.FullCmd2ShortCmd[cmd]; - sb.AppendLine(string.Format(Langs.CommandHelpWithShortName, cmd, shortCmd, args, usage)); - } - else - { - sb.AppendLine(string.Format(Langs.CommandHelpNoShortName, cmd, args, usage)); + sb.AppendLine(string.Format(Langs.CommandHelpWithShortName, shortCmd)); } } } @@ -185,15 +180,14 @@ internal static string ResponseEulaCmdUnavilable() usage = Langs.CommandHelpNoUsage; } + StringBuilder sb = new(); + sb.AppendLine(string.Format(Langs.CommandHelpNoShortName, cmd, cmdArgs, usage)); if (CommandHelpData.FullCmd2ShortCmd.ContainsKey(cmd)) { string shortCmd = CommandHelpData.FullCmd2ShortCmd[cmd]; - return string.Format(Langs.CommandHelpWithShortName, cmd, shortCmd, cmdArgs, usage); - } - else - { - return string.Format(Langs.CommandHelpNoShortName, cmd, cmdArgs, usage); + sb.AppendLine(string.Format(Langs.CommandHelpWithShortName, shortCmd)); } + return sb.ToString(); } return null; } diff --git a/ASFEnhance/Utils.cs b/ASFEnhance/Utils.cs index 169a59c9..f9fa5f08 100644 --- a/ASFEnhance/Utils.cs +++ b/ASFEnhance/Utils.cs @@ -12,7 +12,7 @@ internal static class Utils /// /// 插件配置 /// - internal static PluginConfig Config => ASFEnhance.Config; + internal static PluginConfig Config { get; set; } /// /// 更新已就绪 diff --git a/SetSpecialProfile.py b/SetSpecialProfile.py deleted file mode 100644 index 3a4366da..00000000 --- a/SetSpecialProfile.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -# @Author : Chr_ -# @Date : 2022-06-27 21:22:49 -# @LastEditors : Chr_ -# @LastEditTime : 2022-06-27 22:15:25 -# @Description : Set special profile tooles -""" - -from collections import OrderedDict -import requests -from urllib3 import encode_multipart_formdata - -# Bot"s AccessToken -# (Can be found using ASFEnhance"s ACCESSTOKEN command, requires enable developer ferture) -AccessTokens = [ - "YOUR_ACCESS_TOKEN", - # "YOUR_ACCESS_TOKEN (multiple tokens can be added)", -] - -# Request payload -Argument = "CNqzexCviZ/nThgB" -# Do not use special profile : CNqzexCviZ/nThgA -# Steam 3000 profile : CNqzexCviZ/nThgB -# 2021 winter profile : CMzccBChvIm2SBgB -# 2021 autumn profile : COqzbRCfxLilRhgB -# 2077 game profile : CKzPQhC8pKOxQhgB -# to be continued... - -for token in AccessTokens: - url = "https://api.steampowered.com/IQuestService/ActivateProfileModifierItem/v1" - params = {"access_token": token} - form_data = OrderedDict([ - ("input_protobuf_encoded", Argument), - ]) - data, content_type = encode_multipart_formdata(form_data) - - headers = { - "Content-Type": content_type, - "Referer": "https://steamcommunity.com/", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0", - } - - resp = requests.post(url, params=params, data=data, headers=headers) - print('done!')