Remove magnificent FAQ

This commit is contained in:
appelemac 2016-06-15 16:03:25 +02:00
parent 6d0fe62094
commit 85b6bb555b
3 changed files with 0 additions and 39 deletions

View File

@ -53,38 +53,6 @@ namespace NadekoBot.Modules.Help
await e.Channel.SendMessage("`List of commands:` \n• " + string.Join("\n• ", cmdsArray.Select(c => c.Text))) await e.Channel.SendMessage("`List of commands:` \n• " + string.Join("\n• ", cmdsArray.Select(c => c.Text)))
.ConfigureAwait(false); .ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "faq")
.Description("Browse the FAQ\n**Usage**: `-faq 1` `-faq Q5`")
.Parameter("index", ParameterType.Unparsed)
.Do(async e =>
{
string message = "Something went wrong";
string indexString = e.GetArg("index")?.Trim().ToLowerInvariant();
Regex questiona = new Regex(@"q(uestion)?\s*(?<number>\d+)");
var m = questiona.Match(indexString);
if (m.Success)
{
int index;
if (!int.TryParse(m.Groups["number"].Value, out index) || index < 1|| index > NadekoBot.Config.FAQ.Count)
{
message = "Valid index required";
await e.Channel.SendMessage(message).ConfigureAwait(false);
return;
}
var question = NadekoBot.Config.FAQ.Skip(--index).FirstOrDefault();
message = Discord.Format.Bold(question.Key) + "\n\n" + Discord.Format.Italics(question.Value);
}
else
{
int index;
if (!int.TryParse(indexString, out index) || index < 0) index =1;
message = NadekoBot.Config.FAQ.GetOnPage(--index);
}
await e.Channel.SendMessage(message).ConfigureAwait(false);
});
});
} }
} }
} }

View File

@ -91,10 +91,6 @@ namespace NadekoBot.Classes.JSONModels
} } } }
}; };
public Dictionary<string, string> FAQ = new Dictionary<string, string>()
{
{"Q1: Does Nadeko have music?", "A: The official Nadeko currently does not have music, which means you'll have to host a version yourself (see Q2)" }
};
public List<string> RotatingStatuses { get; set; } = new List<string>(); public List<string> RotatingStatuses { get; set; } = new List<string>();
public CommandPrefixesModel CommandPrefixes { get; set; } = new CommandPrefixesModel(); public CommandPrefixesModel CommandPrefixes { get; set; } = new CommandPrefixesModel();

View File

@ -1,7 +1,4 @@
{ {
"FAQ": {
"Q1: Does Nadeko have music?": "A: The official Nadeko currently does not have music, which means you'll have to host a version yourself (see Q2)"
},
"DontJoinServers": false, "DontJoinServers": false,
"ForwardMessages": true, "ForwardMessages": true,
"IsRotatingStatus": false, "IsRotatingStatus": false,