disabled %rnduser% completely due to performance issues

This commit is contained in:
Kwoth 2017-02-05 19:47:36 +01:00
parent 3388005edb
commit fbd32a6797

View File

@ -23,17 +23,24 @@ namespace NadekoBot.Modules.CustomReactions
{"%mention%", (ctx) => { return $"<@{NadekoBot.Client.CurrentUser.Id}>"; } },
{"%user%", (ctx) => { return ctx.Author.Mention; } },
{"%rnduser%", (ctx) => {
var ch = ctx.Channel as ITextChannel;
if(ch == null)
return "";
//var ch = ctx.Channel as ITextChannel;
//if(ch == null)
// return "";
var g = ch.Guild as SocketGuild;
if(g == null)
return "";
//var g = ch.Guild as SocketGuild;
//if(g == null)
// return "";
//try {
// var usr = g.Users.Skip(new NadekoRandom().Next(0, g.Users.Count)).FirstOrDefault();
// return usr.Mention;
//}
//catch {
return "[%rnduser% is temp. disabled]";
//}
var users = g.Users.ToArray();
//var users = g.Users.ToArray();
return users[new NadekoRandom().Next(0, users.Length-1)].Mention;
//return users[new NadekoRandom().Next(0, users.Length-1)].Mention;
} }
//{"%rng%", (ctx) => { return new NadekoRandom().Next(0,10).ToString(); } }
};