mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 16:11:05 +01:00
Needs Testing
This commit is contained in:
@@ -19,9 +19,9 @@ namespace Tgstation.Server.Api.Models
|
||||
public string? BotToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Boolean to enable based mode (Will auto reply with 'based on the hardware thats installed in it' to anyone saying 'based on what')
|
||||
/// <see cref="bool"/> to enable based mode. Will auto reply with a youtube link to a video that says "based on the hardware that's installed in it" to anyone saying 'based on what?' case-insensitive.
|
||||
/// </summary>
|
||||
public bool BasedMode { get; set; }
|
||||
public bool BasedMeme { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DiscordDMOutputDisplayType"/>.
|
||||
@@ -46,10 +46,11 @@ namespace Tgstation.Server.Api.Models
|
||||
BotToken = splits.First();
|
||||
if (splits.Length < 2 || !Enum.TryParse<DiscordDMOutputDisplayType>(splits[1], out var dMOutputDisplayType))
|
||||
dMOutputDisplayType = DiscordDMOutputDisplayType.Always;
|
||||
DMOutputDisplay = dMOutputDisplayType;
|
||||
if (splits.Length < 3 || !bool.TryParse(splits[2], out bool basedMeme))
|
||||
basedMeme = false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => $"{BotToken};{(int)DMOutputDisplay}";
|
||||
public override string ToString() => $"{BotToken};{(int)DMOutputDisplay};{BasedMeme.ToString()}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
|
||||
readonly string botToken;
|
||||
|
||||
/// <summary>
|
||||
/// Boolean to enable based mode (Will auto reply with 'based on the hardware thats installed in it' to anyone saying 'based on what')
|
||||
/// <see cref="bool"/> to enable based mode. Will auto reply with a youtube link to a video that says "based on the hardware that's installed in it" to anyone saying 'based on what?' case-insensitive.
|
||||
/// </summary>
|
||||
readonly bool basedMode;
|
||||
readonly bool basedMeme;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DiscordDMOutputDisplayType"/>.
|
||||
@@ -87,7 +87,7 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
|
||||
|
||||
var csb = new DiscordConnectionStringBuilder(chatBot.ConnectionString);
|
||||
botToken = csb.BotToken;
|
||||
basedMode = csb.BasedMode;
|
||||
basedMeme = csb.BasedMeme;
|
||||
outputDisplayType = csb.DMOutputDisplay;
|
||||
|
||||
client = new DiscordSocketClient();
|
||||
@@ -116,7 +116,7 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
|
||||
void StartTyping() => typingState = e.Channel.EnterTypingState();
|
||||
try
|
||||
{
|
||||
if (basedMode && e.Content.Equals("Based on what?", StringComparison.OrdinalIgnoreCase))
|
||||
if (basedMeme && e.Content.Equals("Based on what?", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
StartTyping();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user