8ball.json is now in config.json as _8BallResponses, questions.txt are now question.json

This commit is contained in:
Master Kwoth 2016-03-18 23:25:59 +01:00
parent 750303b4ed
commit 17a9193eb3
6 changed files with 57 additions and 29 deletions

View File

@ -9,20 +9,50 @@ namespace NadekoBot.Classes.JSONModels {
public bool DontJoinServers { get; set; } = false; public bool DontJoinServers { get; set; } = false;
public bool ForwardMessages { get; set; } = true; public bool ForwardMessages { get; set; } = true;
public bool IsRotatingStatus { get; set; } = false; public bool IsRotatingStatus { get; set; } = false;
[JsonIgnore] [JsonIgnore]
public List<Quote> Quotes { get; set; } = new List<Quote>(); public List<Quote> Quotes { get; set; } = new List<Quote>();
public HashSet<StreamNotificationConfig> ObservingStreams { get; set; } = new HashSet<StreamNotificationConfig>();
public HashSet<StreamNotificationConfig> ObservingStreams { get; set; } =
new HashSet<StreamNotificationConfig>();
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();
public HashSet<ulong> ServerBlacklist { get; set; } = new HashSet<ulong>(); public HashSet<ulong> ServerBlacklist { get; set; } = new HashSet<ulong>();
public HashSet<ulong> ChannelBlacklist { get; set; } = new HashSet<ulong>(); public HashSet<ulong> ChannelBlacklist { get; set; } = new HashSet<ulong>();
public HashSet<ulong> UserBlacklist { get; set; } = new HashSet<ulong>() { public HashSet<ulong> UserBlacklist { get; set; } = new HashSet<ulong>() {
105309315895693312, 105309315895693312,
119174277298782216, 119174277298782216,
143515953525817344 143515953525817344
}; };
public string[] DisguiseResponses { get; } = { public string[] _8BallResponses { get; set; } =
{
"Most definitely yes",
"For sure",
"As I see it, yes",
"My sources say yes",
"Yes",
"Most likely",
"Perhaps",
"Maybe",
"Not sure",
"It is uncertain",
"Ask me again later",
"Don't count on it",
"Probably not",
"Very doubtful",
"Most likely no",
"Nope",
"No",
"My sources say no",
"Dont even think about it",
"Definitely no",
"NO - It may cause disease contraction"
};
public string[] DisguiseResponses { get; } = {
"https://cdn.discordapp.com/attachments/140007341880901632/156721710458994690/Cc5mixjUYAADgBs.jpg", "https://cdn.discordapp.com/attachments/140007341880901632/156721710458994690/Cc5mixjUYAADgBs.jpg",
"https://cdn.discordapp.com/attachments/140007341880901632/156721715831898113/hqdefault.jpg", "https://cdn.discordapp.com/attachments/140007341880901632/156721715831898113/hqdefault.jpg",
"https://cdn.discordapp.com/attachments/140007341880901632/156721724430352385/okawari_01_haruka_weird_mask.jpg", "https://cdn.discordapp.com/attachments/140007341880901632/156721724430352385/okawari_01_haruka_weird_mask.jpg",

View File

@ -25,7 +25,7 @@ namespace NadekoBot.Classes.Trivia {
} }
internal void Reload() { internal void Reload() {
var arr = JArray.Parse(File.ReadAllText("data/questions.txt")); var arr = JArray.Parse(File.ReadAllText("data/questions.json"));
foreach (var item in arr) { foreach (var item in arr) {
var tq = new TriviaQuestion(item["Question"].ToString(), item["Answer"].ToString(), item["Category"]?.ToString()); var tq = new TriviaQuestion(item["Question"].ToString(), item["Answer"].ToString(), item["Category"]?.ToString());

View File

@ -9,7 +9,6 @@ using NadekoBot.Extensions;
namespace NadekoBot.Modules { namespace NadekoBot.Modules {
internal class Games : DiscordModule { internal class Games : DiscordModule {
private readonly string[] _8BallAnswers;
private readonly Random rng = new Random(); private readonly Random rng = new Random();
public Games() { public Games() {
@ -17,7 +16,6 @@ namespace NadekoBot.Modules {
commands.Add(new SpeedTyping(this)); commands.Add(new SpeedTyping(this));
commands.Add(new PollCommand(this)); commands.Add(new PollCommand(this));
//commands.Add(new BetrayGame(this)); //commands.Add(new BetrayGame(this));
_8BallAnswers = JArray.Parse(File.ReadAllText("data/8ball.json")).Select(t => t.ToString()).ToArray();
} }
public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Games; public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Games;
@ -51,7 +49,7 @@ namespace NadekoBot.Modules {
return; return;
try { try {
await e.Channel.SendMessage( await e.Channel.SendMessage(
$":question: **Question**: `{question}` \n🎱 **8Ball Answers**: `{_8BallAnswers[rng.Next(0, _8BallAnswers.Length)]}`"); $":question: **Question**: `{question}` \n🎱 **8Ball Answers**: `{NadekoBot.Config._8BallResponses[rng.Next(0, NadekoBot.Config._8BallResponses.Length)]}`");
} catch { } } catch { }
}); });

View File

@ -1,23 +0,0 @@
[
"Most definitely yes",
"For sure",
"As I see it, yes",
"My sources say yes",
"Yes",
"Most likely",
"Perhaps",
"Maybe",
"Not sure",
"It is uncertain",
"Ask me again later",
"Don't count on it",
"Probably not",
"Very doubtful",
"Most likely no",
"Nope",
"No",
"My sources say no",
"Dont even think about it",
"Definitely no",
"NO - It may cause disease contraction"
]

View File

@ -25,6 +25,29 @@
119174277298782216, 119174277298782216,
143515953525817344 143515953525817344
], ],
"_8BallResponses": [
"Most definitely yes",
"For sure",
"As I see it, yes",
"My sources say yes",
"Yes",
"Most likely",
"Perhaps",
"Maybe",
"Not sure",
"It is uncertain",
"Ask me again later",
"Don't count on it",
"Probably not",
"Very doubtful",
"Most likely no",
"Nope",
"No",
"My sources say no",
"Dont even think about it",
"Definitely no",
"NO - It may cause disease contraction"
],
"DisguiseResponses": [ "DisguiseResponses": [
"https://cdn.discordapp.com/attachments/140007341880901632/156721710458994690/Cc5mixjUYAADgBs.jpg", "https://cdn.discordapp.com/attachments/140007341880901632/156721710458994690/Cc5mixjUYAADgBs.jpg",
"https://cdn.discordapp.com/attachments/140007341880901632/156721715831898113/hqdefault.jpg", "https://cdn.discordapp.com/attachments/140007341880901632/156721715831898113/hqdefault.jpg",