Update to conform to Kwoth
This commit is contained in:
parent
1bd3e7481c
commit
40390ed17c
@ -15,7 +15,7 @@ namespace NadekoBot.Modules.CustomReactions
|
|||||||
public override void Install(ModuleManager manager)
|
public override void Install(ModuleManager manager)
|
||||||
{
|
{
|
||||||
|
|
||||||
manager.CreateCommands("",cgb =>
|
manager.CreateCommands("", cgb =>
|
||||||
{
|
{
|
||||||
|
|
||||||
cgb.AddCheck(PermissionChecker.Instance);
|
cgb.AddCheck(PermissionChecker.Instance);
|
||||||
@ -42,27 +42,8 @@ namespace NadekoBot.Modules.CustomReactions
|
|||||||
c.Parameter("args", ParameterType.Unparsed);
|
c.Parameter("args", ParameterType.Unparsed);
|
||||||
c.Do(async e =>
|
c.Do(async e =>
|
||||||
{
|
{
|
||||||
|
string str = command.Value[range.Next(0, command.Value.Count())];
|
||||||
var ownerMentioned = e.Message.MentionedUsers.Where(x =>NadekoBot.IsOwner(x.Id));
|
|
||||||
var ownerReactions = command.Value.Where(x => x.Contains("%owner%")).ToList();
|
|
||||||
string str;
|
|
||||||
|
|
||||||
if (ownerMentioned.Any() && ownerReactions.Any())
|
|
||||||
{
|
|
||||||
str = ownerReactions[range.Next(0, ownerReactions.Count)];
|
|
||||||
str = str.Replace("%owner%", ownerMentioned.FirstOrDefault().Mention);
|
|
||||||
}
|
|
||||||
else if (ownerReactions.Any())
|
|
||||||
{
|
|
||||||
var others = command.Value.Except(ownerReactions).ToList();
|
|
||||||
str = others[range.Next(0, others.Count())];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
str = command.Value[range.Next(0, command.Value.Count())];
|
|
||||||
}
|
|
||||||
MyFuncs.Keys.ForEach(k => str = str.Replace(k, MyFuncs[k](e)));
|
MyFuncs.Keys.ForEach(k => str = str.Replace(k, MyFuncs[k](e)));
|
||||||
|
|
||||||
await e.Channel.SendMessage(str).ConfigureAwait(false);
|
await e.Channel.SendMessage(str).ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user