Skip to content

Commit

Permalink
fix bug修正
Browse files Browse the repository at this point in the history
feat 修改命令参数返回格式
  • Loading branch information
chr233 committed Nov 23, 2022
1 parent d801144 commit 424d1b4
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 69 deletions.
6 changes: 3 additions & 3 deletions ASFEnhance/ASFEnhance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/// <summary>
/// ASF启动事件
Expand All @@ -32,7 +32,7 @@ public Task OnASFInit(IReadOnlyDictionary<string, JToken>? additionalConfigPrope
{
if (additionalConfigProperties == null)
{
Config = new();
Utils.Config = new();
return Task.CompletedTask;
}

Expand Down Expand Up @@ -67,7 +67,7 @@ public Task OnASFInit(IReadOnlyDictionary<string, JToken>? additionalConfigPrope
}
}

Config = config ?? new();
Utils.Config = config ?? new();

if (Config.DevFeature)
{
Expand Down
4 changes: 2 additions & 2 deletions ASFEnhance/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion ASFEnhance/Localization/Langs.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ASFEnhance/Localization/Langs.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
<value>The plugin is up to date, no need to update</value>
</data>
<data name="CommandHelpWithShortName" xml:space="preserve">
<value>- {0} / {1} {2} : {3}</value>
<value> * Avilable shortcut: {0}</value>
</data>
<data name="CommandHelpNoShortName" xml:space="preserve">
<value>- {0} {1} : {2}</value>
Expand Down
2 changes: 1 addition & 1 deletion ASFEnhance/Localization/Langs.resx
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@
<value>- {0} {1} : {2}</value>
</data>
<data name="CommandHelpWithShortName" xml:space="preserve">
<value>- {0} / {1} {2} : {3}</value>
<value> * 可用缩写 : {0}</value>
</data>
<data name="CommandHelpCmdNotFound" xml:space="preserve">
<value>找不到相关命令的帮助</value>
Expand Down
2 changes: 1 addition & 1 deletion ASFEnhance/Localization/Langs.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
<value>当前已经是最新版本, 无需更新插件</value>
</data>
<data name="CommandHelpWithShortName" xml:space="preserve">
<value>- {0} / {1} {2} : {3}</value>
<value> * 可用缩写 : {0}</value>
</data>
<data name="CommandHelpNoShortName" xml:space="preserve">
<value>- {0} {1} : {2}</value>
Expand Down
24 changes: 9 additions & 15 deletions ASFEnhance/Other/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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));
}
}
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion ASFEnhance/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal static class Utils
/// <summary>
/// 插件配置
/// </summary>
internal static PluginConfig Config => ASFEnhance.Config;
internal static PluginConfig Config { get; set; }

/// <summary>
/// 更新已就绪
Expand Down
44 changes: 0 additions & 44 deletions SetSpecialProfile.py

This file was deleted.

0 comments on commit 424d1b4

Please sign in to comment.