Example #1
0
        private async Task ReactionAdded(Cacheable <IUserMessage, ulong> arg1, ISocketMessageChannel arg2, SocketReaction arg3)
        {
            var amount  = 1;
            var msgId   = arg3.MessageId;
            var channel = (ITextChannel)arg2;

            //TODO: Don't duplicate previously pinned messages, use reaction count
            if (arg1.Id == 640802444233670676)
            {
                int originalAmount = 0;
                foreach (var pair in JackFrostBot.UserSettings.Currency.Get(channel.Guild.Id))
                {
                    if (pair.Item1 == arg3.UserId.ToString())
                    {
                        originalAmount = pair.Item2;
                    }
                }
                JackFrostBot.UserSettings.Currency.Add(channel.Guild.Id, arg3.UserId, amount);

                var botlog = await channel.Guild.GetTextChannelAsync(JackFrostBot.UserSettings.Channels.BotLogsId(channel.Guild.Id));

                var botchannel = await channel.Guild.GetTextChannelAsync(JackFrostBot.UserSettings.Channels.BotChannelId(channel.Guild.Id));

                Embed embed = Embeds.Earn(arg3.User.ToString(), amount, channel.Guild.Id);
                await botlog.SendMessageAsync("", embed : embed).ConfigureAwait(false);

                await botchannel.SendMessageAsync("", embed : embed).ConfigureAwait(false);
            }
        }