69 lines
No EOL
1.9 KiB
C#
69 lines
No EOL
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace SecondBotEvents.Config
|
|
{
|
|
public class DiscordConfig : Config
|
|
{
|
|
public DiscordConfig(bool fromENV, string fromFolder = "") : base(fromENV, fromFolder) { }
|
|
protected override void MakeSettings()
|
|
{
|
|
filename = "discord";
|
|
settings.Add("Enabled");
|
|
settings.Add("ServerID");
|
|
settings.Add("ClientToken");
|
|
settings.Add("AllowDiscordCommands");
|
|
settings.Add("InteractionEnabled");
|
|
settings.Add("InteractionCommandName");
|
|
settings.Add("InteractionHttpTarget");
|
|
settings.Add("InteractionChannelNumber");
|
|
settings.Add("HideStatusOutput");
|
|
}
|
|
|
|
public bool GetEnabled()
|
|
{
|
|
return ReadSettingAsBool("Enabled");
|
|
}
|
|
|
|
public ulong GetServerID()
|
|
{
|
|
return ReadSettingAsUlong("ServerID", 0);
|
|
}
|
|
|
|
public string GetClientToken()
|
|
{
|
|
return ReadSettingAsString("ClientToken","tokenPlzKThanks");
|
|
}
|
|
|
|
public bool GetAllowDiscordCommands()
|
|
{
|
|
return ReadSettingAsBool("AllowDiscordCommands");
|
|
}
|
|
|
|
public bool GetInteractionEnabled()
|
|
{
|
|
return ReadSettingAsBool("InteractionEnabled");
|
|
}
|
|
|
|
public string GetInteractionHttpTarget()
|
|
{
|
|
return ReadSettingAsString("InteractionHttpTarget", "https://localhost/interaction.php");
|
|
}
|
|
|
|
public string GetInteractionCommandName()
|
|
{
|
|
return ReadSettingAsString("InteractionCommandName","Go");
|
|
}
|
|
|
|
public string GetInteractionChannelNumber()
|
|
{
|
|
return ReadSettingAsString("InteractionChannelNumber", "-1");
|
|
}
|
|
|
|
public void SetInteractionEnabled(bool enabled)
|
|
{
|
|
mysettings["InteractionEnabled"] = enabled.ToString();
|
|
}
|
|
}
|
|
} |