externalized pats/cries

This commit is contained in:
Master Kwoth 2016-03-04 17:55:13 +01:00
parent c1ccc7d4d2
commit bc0da6e8c2
3 changed files with 34 additions and 17 deletions

View File

@ -12,5 +12,23 @@ namespace NadekoBot.Classes.JSONModels {
119174277298782216, 119174277298782216,
143515953525817344 143515953525817344
}; };
public string[] CryResponses = {
"http://i.imgur.com/Xg3i1Qy.gif",
"http://i.imgur.com/3K8DRrU.gif",
"http://i.imgur.com/k58BcAv.gif",
"http://i.imgur.com/I2fLXwo.gif"
};
public string[] PatResponses = {
"http://i.imgur.com/IiQwK12.gif",
"http://i.imgur.com/JCXj8yD.gif",
"http://i.imgur.com/qqBl2bm.gif",
"http://i.imgur.com/eOJlnwP.gif",
"https://45.media.tumblr.com/229ec0458891c4dcd847545c81e760a5/tumblr_mpfy232F4j1rxrpjzo1_r2_500.gif",
"https://media.giphy.com/media/KZQlfylo73AMU/giphy.gif",
"https://media.giphy.com/media/12hvLuZ7uzvCvK/giphy.gif",
"http://gallery1.anivide.com/_full/65030_1382582341.gif",
"https://49.media.tumblr.com/8e8a099c4eba22abd3ec0f70fd087cce/tumblr_nxovj9oY861ur1mffo1_500.gif ",
};
} }
} }

View File

@ -39,6 +39,7 @@ namespace NadekoBot.Commands
cgb.CreateCommand("copyme") cgb.CreateCommand("copyme")
.Alias("cm") .Alias("cm")
.Description("Nadeko starts copying everything you say. Disable with cs") .Description("Nadeko starts copying everything you say. Disable with cs")
.Parameter("silent")
.Do(DoFunc()); .Do(DoFunc());
cgb.CreateCommand("cs") cgb.CreateCommand("cs")

View File

@ -177,27 +177,25 @@ namespace NadekoBot.Modules {
.Do(async e => { .Do(async e => {
var user = e.GetArg("user"); var user = e.GetArg("user");
if (string.IsNullOrWhiteSpace(user) || !e.Message.MentionedUsers.Any()) return; if (string.IsNullOrWhiteSpace(user) || !e.Message.MentionedUsers.Any()) return;
string[] pats = { "http://i.imgur.com/IiQwK12.gif", try {
"http://i.imgur.com/JCXj8yD.gif", await e.Channel.SendMessage(
"http://i.imgur.com/qqBl2bm.gif", $"{e.Message.MentionedUsers.First().Mention} " +
"http://i.imgur.com/eOJlnwP.gif", $"{NadekoBot.Config.PatResponses[rng.Next(0, NadekoBot.Config.PatResponses.Length)]}");
"https://45.media.tumblr.com/229ec0458891c4dcd847545c81e760a5/tumblr_mpfy232F4j1rxrpjzo1_r2_500.gif", } catch {
"https://media.giphy.com/media/KZQlfylo73AMU/giphy.gif", await e.Channel.SendMessage("Error while handling PatResponses check your data/config.json");
"https://media.giphy.com/media/12hvLuZ7uzvCvK/giphy.gif", }
"http://gallery1.anivide.com/_full/65030_1382582341.gif",
"https://49.media.tumblr.com/8e8a099c4eba22abd3ec0f70fd087cce/tumblr_nxovj9oY861ur1mffo1_500.gif ",
};
await e.Channel.SendMessage($"{e.Message.MentionedUsers.First().Mention} {pats[rng.Next(0, pats.Length)]}");
}); });
cgb.CreateCommand("cry") cgb.CreateCommand("cry")
.Description("Tell Nadeko to cry. You are a heartless monster if you use this command.") .Description("Tell Nadeko to cry. You are a heartless monster if you use this command.")
.Do(async e => { .Do(async e => {
string[] pats = { "http://i.imgur.com/Xg3i1Qy.gif", try {
"http://i.imgur.com/3K8DRrU.gif", await
"http://i.imgur.com/k58BcAv.gif", e.Channel.SendMessage(
"http://i.imgur.com/I2fLXwo.gif" }; $"(•̥́ _•ૅ。)\n{NadekoBot.Config.CryResponses[rng.Next(0, NadekoBot.Config.CryResponses.Length)]}");
await e.Channel.SendMessage($"(•̥́ _•ૅ。)\n{pats[rng.Next(0, pats.Length)]}"); } catch {
await e.Channel.SendMessage("Error while handling CryResponses check your data/config.json");
}
}); });
cgb.CreateCommand("are you real") cgb.CreateCommand("are you real")
@ -277,7 +275,7 @@ namespace NadekoBot.Modules {
var msgs = (await e.Channel.DownloadMessages(100)) var msgs = (await e.Channel.DownloadMessages(100))
.Where(m => m.MentionedUsers.Contains(e.User)) .Where(m => m.MentionedUsers.Contains(e.User))
.OrderByDescending(m => m.Timestamp); .OrderByDescending(m => m.Timestamp);
if (msgs.Count() > 0) if (msgs.Any())
msg = msgs.First(); msg = msgs.First();
else { else {
var attempt = 0; var attempt = 0;