Make thanks responses iterate as to prevent responses from repeating themselves often
This commit is contained in:
parent
6097515b5b
commit
929abcf7e0
|
@ -75,14 +75,16 @@ namespace DeukBot4.MessageHandlers
|
||||||
"It was the least I could do, I always do the least I can do!",
|
"It was the least I could do, I always do the least I can do!",
|
||||||
"Yes, well, we'd be absolutely nowhere without me.",
|
"Yes, well, we'd be absolutely nowhere without me.",
|
||||||
"Yeah no problem, I'm the only one who does work around here anyway",
|
"Yeah no problem, I'm the only one who does work around here anyway",
|
||||||
|
"I gotchu, bb."
|
||||||
};
|
};
|
||||||
private static readonly Random Rand = new Random();
|
private static int _pos = 0;
|
||||||
public static async Task ThanksHandler(SocketMessage message)
|
public static async Task ThanksHandler(SocketMessage message)
|
||||||
{
|
{
|
||||||
var content = message.Content;
|
var content = message.Content;
|
||||||
if (ThanksMatcher.IsMatch(content))
|
if (ThanksMatcher.IsMatch(content))
|
||||||
{
|
{
|
||||||
var response = ThanksResponses[Rand.Next(0, ThanksResponses.Length)];
|
var response = ThanksResponses[_pos];
|
||||||
|
_pos = (_pos + 1) % ThanksResponses.Length;
|
||||||
message.Channel.SendMessageAsync(response);
|
message.Channel.SendMessageAsync(response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue