Example #1
0
 private async Task ReactionAdded(Cacheable <IUserMessage, ulong> cacheMessage, ISocketMessageChannel channel, SocketReaction reaction)
 {
     if (reaction.User.Value.IsBot)
     {
         return;
     }
     _triviaGames.HandleReactionAdded(cacheMessage, reaction);
     BlogHandler.ReactionAdded(reaction);
 }
        private async Task ReactionAdded(Cacheable <IUserMessage, ulong> cacheMessage, ISocketMessageChannel channel, SocketReaction reaction)
        {
            if (reaction.User.Value.IsBot)
            {
                return;
            }

            InversionOfControl.Container.GetInstance <ListManager>().HandleReactionAdded(cacheMessage, reaction);

            _triviaGames.HandleReactionAdded(cacheMessage, reaction);
            BlogHandler.ReactionAdded(reaction);
        }
Example #3
0
        public static async Task ReactionAdded(SocketReaction reaction)
        {
            var msgList = Global.MessagesIdToTrack ?? new Dictionary <ulong, string>();

            if (msgList.ContainsKey(reaction.MessageId))
            {
                if (reaction.Emote.Name == "➕")
                {
                    var item  = msgList.FirstOrDefault(k => k.Key == reaction.MessageId);
                    var embed = BlogHandler.SubscribeToBlog(reaction.User.Value.Id, item.Value);
                }
            }
        }
        private async Task ReactionAdded(Cacheable <IUserMessage, ulong> cacheMessage, ISocketMessageChannel channel, SocketReaction reaction)
        {
            if (reaction.User.Value.IsBot)
            {
                return;
            }

            var user    = _client.Guilds.First().GetUser(reaction.UserId);
            var roleIds = user.Roles.Select(r => r.Id).ToArray();

            (new ListReactionHandler()).HandleReactionAdded(new ListHelper.UserInfo(user.Id, roleIds), _listManager, cacheMessage, reaction);

            _triviaGames.HandleReactionAdded(cacheMessage, reaction);
            BlogHandler.ReactionAdded(reaction);
        }
 public DiscordEventHandler(Logger logger, TriviaGames triviaGames, DiscordSocketClient client, CommandHandler commandHandler, ApplicationSettings applicationSettings, ListManager listManager, IOnboarding onboarding, BlogHandler blogHandler, Announcements announcements, MessageRewardHandler messageRewardHandler, RepeatedTaskFunctions repeatedTaskFunctions, GlobalGuildAccounts globalGuildAccounts)
 {
     _logger                = logger;
     _client                = client;
     _commandHandler        = commandHandler;
     _applicationSettings   = applicationSettings;
     _triviaGames           = triviaGames;
     _listManager           = listManager;
     _onboarding            = onboarding;
     _blogHandler           = blogHandler;
     _announcements         = announcements;
     _messageRewardHandler  = messageRewardHandler;
     _repeatedTaskFunctions = repeatedTaskFunctions;
     _globalGuildAccounts   = globalGuildAccounts;
 }