increased timeout, prefixes configurable

This commit is contained in:
Master Kwoth 2016-03-11 21:40:05 +01:00
parent c7d18c5853
commit 5275058553
5 changed files with 31 additions and 3 deletions

View File

@ -11,6 +11,7 @@ namespace NadekoBot.Classes.JSONModels {
public bool IsRotatingStatus { get; set; } = false;
public bool SendPrivateMessageOnMention { get; set; } = false;
public List<string> RotatingStatuses { get; set; } = new List<string>();
public CommandPrefixesModel CommandPrefixes { get; set; } = new CommandPrefixesModel();
public HashSet<ulong> ServerBlacklist { get; set; } = new HashSet<ulong>();
public HashSet<ulong> ChannelBlacklist { get; set; } = new HashSet<ulong>();
public HashSet<ulong> UserBlacklist { get; set; } = new HashSet<ulong>() {
@ -46,6 +47,20 @@ namespace NadekoBot.Classes.JSONModels {
};
}
public class CommandPrefixesModel
{
public string Administration { get; set; } = ".";
public string Searches { get; set; } = "~";
public string NSFW { get; set; } = "~";
public string Conversations { get; set; } = "<@{0}>";
public string ClashOfClans { get; set; } = ",";
public string Help { get; set; } = "-";
public string Music { get; set; } = "!m";
public string Trello { get; set; } = "trello";
public string Games { get; set; } = ">";
public string Gambling { get; set; } = "$";
}
public static class ConfigHandler {
private static readonly object configLock = new object();
public static void SaveConfig() {

View File

@ -23,7 +23,7 @@ namespace NadekoBot.Modules {
commands.Add(new VoicePlusTextCommand(this));
}
public override string Prefix { get; } = ".";
public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Administration;
public override void Install(ModuleManager manager) {
manager.CreateCommands("", cgb => {

View File

@ -10,7 +10,7 @@ using Action = Manatee.Trello.Action;
namespace NadekoBot.Modules {
internal class Trello : DiscordModule {
private readonly Timer t = new Timer() { Interval = 2000 };
private readonly Timer t = new Timer { Interval = 2000 };
public override string Prefix { get; } = "trello";
public override void Install(ModuleManager manager) {

View File

@ -71,6 +71,7 @@ namespace NadekoBot {
//create new discord client and log
Client = new DiscordClient(new DiscordConfigBuilder() {
MessageCacheSize = 10,
ConnectionTimeout = 60000,
LogLevel = LogSeverity.Warning,
LogHandler = (s, e) =>
Console.WriteLine($"Severity: {e.Severity}" +
@ -118,7 +119,7 @@ namespace NadekoBot {
modules.Add(new Conversations(), "Conversations", ModuleFilter.None);
modules.Add(new Gambling(), "Gambling", ModuleFilter.None);
modules.Add(new Games(), "Games", ModuleFilter.None);
modules.Add(new Music(), "Music", ModuleFilter.None);
//modules.Add(new Music(), "Music", ModuleFilter.None);
modules.Add(new Searches(), "Searches", ModuleFilter.None);
modules.Add(new NSFW(), "NSFW", ModuleFilter.None);
modules.Add(new ClashOfClans(), "ClashOfClans", ModuleFilter.None);

View File

@ -4,6 +4,18 @@
"IsRotatingStatus": false,
"SendPrivateMessageOnMention": false,
"RotatingStatuses": [],
"CommandPrefixes": {
"Administration": ".",
"Searches": "~",
"NSFW": "~",
"Conversations": "<@{0}>",
"ClashOfClans": ",",
"Help": "-",
"Music": "!m",
"Trello": "trello",
"Games": ">",
"Gambling": "$"
},
"ServerBlacklist": [],
"ChannelBlacklist": [],
"UserBlacklist": [