gave up on command, commented out, will continue in the future maybe

This commit is contained in:
Kwoth 2017-02-06 09:35:49 +01:00
parent b73b670f6f
commit ba8e906c97
2 changed files with 56 additions and 8 deletions

View File

@ -125,7 +125,7 @@ namespace NadekoBot.Modules.Gambling
{ {
var msg = await Context.Channel.SendConfirmAsync("Flower reaction event started!", var msg = await Context.Channel.SendConfirmAsync("Flower reaction event started!",
"Add 🌸 reaction to this message to get 100" + NadekoBot.BotConfig.CurrencySign, "Add 🌸 reaction to this message to get 100" + NadekoBot.BotConfig.CurrencySign,
footer: "This event is active for 24 hours.") footer: "This event is active for up to 24 hours.")
.ConfigureAwait(false); .ConfigureAwait(false);
try { await msg.AddReactionAsync("🌸").ConfigureAwait(false); } try { await msg.AddReactionAsync("🌸").ConfigureAwait(false); }
catch catch

View File

@ -37,22 +37,68 @@ namespace NadekoBot.Modules.Utility
// return; // return;
// var j = 0; // var j = 0;
// var roles = roleNames.Select(x => Context.Guild.Roles.FirstOrDefault(r => String.Compare(r.Name, x) == 0)) // var roles = roleNames.Select(x => Context.Guild.Roles.FirstOrDefault(r => String.Compare(r.Name, x, StringComparison.OrdinalIgnoreCase) == 0))
// .Where(x => x != null) // .Where(x => x != null)
// .Select(x => $"`{++j}.` {x.Name}")
// .Take(10) // .Take(10)
// .ToArray(); // .ToArray();
// string[] reactions = { "one", ":two:", ":three:", ":four:", ":five:", ":six:", ":seven:", ":eight:", ":nine:", ":ten:" }; // var rnd = new NadekoRandom();
// var reactions = new[] { "🎬", "🐧", "🌍", "🌺", "🚀", "☀", "🌲", "🍒", "🐾", "🏀" }
// .OrderBy(x => rnd.Next())
// .ToArray();
// var roleStrings = roles
// .Select(x => $"{reactions[j++]} -> {x.Name}");
// var msg = await Context.Channel.SendConfirmAsync("Pick a Role", // var msg = await Context.Channel.SendConfirmAsync("Pick a Role",
// string.Join("\n", roles)).ConfigureAwait(false); // string.Join("\n", roleStrings)).ConfigureAwait(false);
// for (int i = 0; i < roles.Length; i++) // for (int i = 0; i < roles.Length; i++)
// { // {
// await msg.AddReactionAsync(reactions[i]).ConfigureAwait(false); // try { await msg.AddReactionAsync(reactions[i]).ConfigureAwait(false); }
// catch (Exception ex) { _log.Warn(ex); }
// await Task.Delay(1000).ConfigureAwait(false); // await Task.Delay(1000).ConfigureAwait(false);
// } // }
// msg.OnReaction((r) => Task.Run(async () =>
// {
// try
// {
// var usr = r.User.GetValueOrDefault() as IGuildUser;
// if (usr == null)
// return;
// var index = Array.IndexOf<string>(reactions, r.Emoji.Name);
// if (index == -1)
// return;
// await usr.RemoveRolesAsync(roles[index]);
// }
// catch (Exception ex)
// {
// _log.Warn(ex);
// }
// }), (r) => Task.Run(async () =>
// {
// try
// {
// var usr = r.User.GetValueOrDefault() as IGuildUser;
// if (usr == null)
// return;
// var index = Array.IndexOf<string>(reactions, r.Emoji.Name);
// if (index == -1)
// return;
// await usr.RemoveRolesAsync(roles[index]);
// }
// catch (Exception ex)
// {
// _log.Warn(ex);
// }
// }));
//} //}
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -147,7 +193,8 @@ namespace NadekoBot.Modules.Utility
return; return;
var socketGuild = Context.Guild as SocketGuild; var socketGuild = Context.Guild as SocketGuild;
if (socketGuild == null) { if (socketGuild == null)
{
_log.Warn("Can't cast guild to socket guild."); _log.Warn("Can't cast guild to socket guild.");
return; return;
} }
@ -325,7 +372,8 @@ namespace NadekoBot.Modules.Utility
await Context.Channel.SendPaginatedConfirmAsync(page, (curPage) => { await Context.Channel.SendPaginatedConfirmAsync(page, (curPage) =>
{
var str = string.Join("\n", allShardStrings.Skip(25 * (curPage - 1)).Take(25)); var str = string.Join("\n", allShardStrings.Skip(25 * (curPage - 1)).Take(25));