Skip to content

Instantly share code, notes, and snippets.

@HurricanKai
Created December 3, 2017 17:37
Show Gist options
  • Save HurricanKai/6e13478cc25baa4c259bc5d2315e67ad to your computer and use it in GitHub Desktop.
Save HurricanKai/6e13478cc25baa4c259bc5d2315e67ad to your computer and use it in GitHub Desktop.
For Sharing
var channel = ctx.Guild.GetChannel((ulong)v.channelid);
//Get Resulsts, and Post in First Message.
foreach (var v2 in v.Ids)
{
var message = await channel.GetMessageAsync((ulong)v2.PurpleId);
foreach (var v3 in avatars)
{
var reactors = await message.GetReactionsAsync(v3.Value);
if (votes.TryGetValue(v3.Key, out int Value))
{
votes.Remove(v3.Key);
votes.Add(v3.Key, Value + reactors.Count);
}
else
votes.Add(v3.Key, reactors.Count);
if (voters.TryGetValue(v3.Key, out List<DiscordUser> value))
{
voters.Remove(v3.Key);
value.AddRange(reactors);
voters.Add(v3.Key, value);
}
else
voters.Add(v3.Key, reactors.ToList());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment