disabled %rnduser% completely due to performance issues
This commit is contained in:
parent
3388005edb
commit
fbd32a6797
@ -23,17 +23,24 @@ namespace NadekoBot.Modules.CustomReactions
|
|||||||
{"%mention%", (ctx) => { return $"<@{NadekoBot.Client.CurrentUser.Id}>"; } },
|
{"%mention%", (ctx) => { return $"<@{NadekoBot.Client.CurrentUser.Id}>"; } },
|
||||||
{"%user%", (ctx) => { return ctx.Author.Mention; } },
|
{"%user%", (ctx) => { return ctx.Author.Mention; } },
|
||||||
{"%rnduser%", (ctx) => {
|
{"%rnduser%", (ctx) => {
|
||||||
var ch = ctx.Channel as ITextChannel;
|
//var ch = ctx.Channel as ITextChannel;
|
||||||
if(ch == null)
|
//if(ch == null)
|
||||||
return "";
|
// return "";
|
||||||
|
|
||||||
var g = ch.Guild as SocketGuild;
|
//var g = ch.Guild as SocketGuild;
|
||||||
if(g == null)
|
//if(g == null)
|
||||||
return "";
|
// 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(); } }
|
//{"%rng%", (ctx) => { return new NadekoRandom().Next(0,10).ToString(); } }
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user