Sha256: 86f5dcfe2c171a18adc41b3afad46df5f653883957a19fefa4e30d793d4568ff

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

module Artaius
  module Plugins
    # Gives a voice for everyone, who has a premium account in King Arthur's
    # Gold and registered.
    class Autovoicer
      include Cinch::Plugin

      listen_to :join

      def listen(m)
        return if m.user.nick == bot.nick

        m.channel.voice(m.user) if premium?(m.user.authname)
      end

      def premium?(irc_authname)
        Player.filter(:irc_authname => irc_authname).select_map(:premium).first
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
artaius-0.2.1 lib/artaius/plugins/autovoicer.rb