Example #1
0
        private async Task OnReactionAddedAsync(Cacheable <IUserMessage, ulong> message, ISocketMessageChannel channel, SocketReaction reaction)
        {
            InternalStatistics.IncrementEvent("ReactionAdded");

            using var scope = Provider.CreateScope();
            await scope.ServiceProvider.GetService <EmoteStats>().IncrementFromReactionAsync(reaction);

            if (reaction.User.IsSpecified && reaction.User.Value.IsUser())
            {
                await PaginationService.HandleReactionAsync(reaction);

                await scope.ServiceProvider.GetService <UserReactionsService>().IncrementReactionStatsAsync(reaction);

                await scope.ServiceProvider.GetService <ReminderService>().HandleRemindCopyAsync(reaction);

                if (channel is SocketTextChannel textChannel)
                {
                    await scope.ServiceProvider.GetService <PointsService>().IncrementPointsAsync(textChannel.Guild, reaction);
                }

                if (message.HasValue)
                {
                    await scope.ServiceProvider.GetService <ReminderService>().PostponeReminderAsync(message.Value, reaction);
                }
            }
        }
Example #2
0
        private async Task OnReactionAddedAsync(Cacheable <IUserMessage, ulong> message, ISocketMessageChannel channel, SocketReaction reaction)
        {
            InternalStatistics.IncrementEvent("ReactionAdded");

            EmoteStats.IncrementFromReaction(reaction);
            await PaginationService.HandleReactionAsync(reaction);

            UserService.IncrementReaction(reaction);
        }