Sha256: 723cac9e448a38aee9775765a53cbeca92c3ca495be492b7c7fc96c664676f11

Contents?: true

Size: 384 Bytes

Versions: 4

Compression:

Stored size: 384 Bytes

Contents

# -*- coding: utf-8 -*-
module Cinch
  # An alteration to the Plugin Module to allow for configurable cooldowns.
  module Plugin
    # Add the pre hook to all messages triggered
    module ClassMethods
      def enforce_cooldown
        hook(:pre,
             for: [:match],
             method: ->(m) { Cooldowns.finished?(m, shared[:cooldown], @bot) })
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cinch-cooldown-1.2.1 lib/cinch/plugin/hooks.rb
cinch-cooldown-1.2.0 lib/cinch/plugin/hooks.rb
cinch-cooldown-1.1.7 lib/cinch/plugin/hooks.rb
cinch-cooldown-1.1.5 lib/cinch/plugin/hooks.rb