Class: Muzang::Plugins::Motd

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/muzang-plugins/muzang-motd.rb

Instance Method Summary collapse

Methods included from Helpers

#create_database, #match, #on_channel, #on_join

Constructor Details

#initialize(bot) ⇒ Motd

Returns a new instance of Motd.



8
9
10
# File 'lib/muzang-plugins/muzang-motd.rb', line 8

def initialize(bot)
  @bot = bot
end

Instance Method Details

#call(connection, message) ⇒ Object



12
13
14
15
16
# File 'lib/muzang-plugins/muzang-motd.rb', line 12

def call(connection, message)
  on_join(connection, message) do
    connection.msg(message.channel, "Muzang | Version: #{Muzang::VERSION} | Plugins: #{plugins}")
  end
end

#pluginsObject



18
19
20
21
22
# File 'lib/muzang-plugins/muzang-motd.rb', line 18

def plugins
  list = ""
  @bot.plugins.each{|plugin, instance| list << "*#{plugin}* "}
  list
end