Removed the mandatory requirement to enter the '!' after the discord prefix

This commit is contained in:
Brett Hewitson 2021-12-16 15:57:38 +10:00
parent 327103182c
commit d51c0a95de
14 changed files with 62 additions and 18 deletions

View file

@ -856,6 +856,9 @@
</ArrayOfString>
</value>
</setting>
<setting name="DiscordBotPrefixFixed" serializeAs="String">
<value>False</value>
</setting>
</ServerManagerTool.Config>
</userSettings>
</configuration>

View file

@ -285,6 +285,13 @@ namespace ServerManagerTool
CommonConfig.Default.Save();
}
}
if (!Config.Default.DiscordBotPrefixFixed)
{
Config.Default.DiscordBotPrefix += "!";
Config.Default.DiscordBotPrefixFixed = true;
Config.Default.Save();
Config.Default.Reload();
}
Config.Default.SteamCmdRedirectOutput = false;
}

View file

@ -3000,5 +3000,17 @@ namespace ServerManagerTool {
this["DiscordBotWhitelist"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool DiscordBotPrefixFixed {
get {
return ((bool)(this["DiscordBotPrefixFixed"]));
}
set {
this["DiscordBotPrefixFixed"] = value;
}
}
}
}

View file

@ -830,5 +830,8 @@
&lt;string /&gt;
&lt;/ArrayOfString&gt;</Value>
</Setting>
<Setting Name="DiscordBotPrefixFixed" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -26,6 +26,7 @@
<br/>
<ul>
<li>Made changes to the code to help improve performance.</li>
<li>Removed the mandatory requirement to enter the '!' after the discord prefix. The '!' has been added to the existing prefix so to to change the existing prefix, but you can now changeit.</li>
<li>zh-CN Translation file updated.</li>
</ul>
</p>

View file

@ -24,6 +24,7 @@
<u style="font-size: .9em;">CHANGE</u>
<br/>
<ul>
<li>Removed the mandatory requirement to enter the '!' after the discord prefix. The '!' has been added to the existing prefix so to to change the existing prefix, but you can now changeit.</li>
<li>zh-CN Translation file updated.</li>
</ul>
</p>

View file

@ -622,6 +622,9 @@
</ArrayOfString>
</value>
</setting>
<setting name="DiscordBotPrefixFixed" serializeAs="String">
<value>False</value>
</setting>
</ServerManagerTool.Config>
</userSettings>
</configuration>

View file

@ -278,6 +278,13 @@ namespace ServerManagerTool
Config.Default.UpgradeConfig = false;
Config.Default.Save();
}
if (!Config.Default.DiscordBotPrefixFixed)
{
Config.Default.DiscordBotPrefix += "!";
Config.Default.DiscordBotPrefixFixed = true;
Config.Default.Save();
Config.Default.Reload();
}
Config.Default.SteamCmdRedirectOutput = false;
}

View file

@ -2153,5 +2153,17 @@ namespace ServerManagerTool {
this["DiscordBotWhitelist"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool DiscordBotPrefixFixed {
get {
return ((bool)(this["DiscordBotPrefixFixed"]));
}
set {
this["DiscordBotPrefixFixed"] = value;
}
}
}
}

View file

@ -596,5 +596,8 @@
&lt;string /&gt;
&lt;/ArrayOfString&gt;</Value>
</Setting>
<Setting Name="DiscordBotPrefixFixed" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -26,6 +26,7 @@
<br/>
<ul>
<li>Made changes to the code to help improve performance.</li>
<li>Removed the mandatory requirement to enter the '!' after the discord prefix. The '!' has been added to the existing prefix so to to change the existing prefix, but you can now changeit.</li>
</ul>
</p>
</div>

View file

@ -21,6 +21,11 @@
<ul>
<li>Server Settings - Discord Bot section - Added an alias that can be used with the discord command instead of the profile id.</li>
</ul>
<u style="font-size: .9em;">CHANGE</u>
<br/>
<ul>
<li>Removed the mandatory requirement to enter the '!' after the discord prefix. The '!' has been added to the existing prefix so to to change the existing prefix, but you can now changeit.</li>
</ul>
</p>
</div>
</content>

View file

@ -1,9 +0,0 @@
using ServerManagerTool.DiscordBot.Delegates;
namespace ServerManagerTool.DiscordBot
{
public static class DiscordBot
{
public const string PREFIX_DELIMITER = "!";
}
}

View file

@ -43,15 +43,10 @@ namespace ServerManagerTool.DiscordBot
Token = token;
if (commandPrefix.Any(c => !char.IsLetterOrDigit(c)))
{
throw new Exception("#DiscordBot_InvalidPrefixError");
}
if (!commandPrefix.EndsWith(DiscordBot.PREFIX_DELIMITER))
{
commandPrefix += DiscordBot.PREFIX_DELIMITER;
}
//if (commandPrefix.Any(c => !char.IsLetterOrDigit(c)))
//{
// throw new Exception("#DiscordBot_InvalidPrefixError");
//}
var settings = new Dictionary<string, string>
{