예제 #1
0
        private Task OnReactionRemoved(Cacheable <IUserMessage, ulong> cache, ISocketMessageChannel channel, SocketReaction reaction)
        {
            if (_options.Dispense && cache.Id == _options.Message.Id)
            {
                _reactions.Remove(reaction);
                Dispense?.Invoke(reaction);
            }

            return(Task.CompletedTask);
        }
        private Task OnMessageDeleted(Cacheable <IMessage, ulong> cache, ISocketMessageChannel channel)
        {
            if (_options.Dispense && channel.Id == _options.Channel.Id)
            {
                var msg = _messages.Find(x => x.Id == cache.Id);

                if (msg != null)
                {
                    _messages.Remove(msg);
                    Dispense?.Invoke(msg);
                }
            }

            return(Task.CompletedTask);
        }