Module: Cinch::Helpers

Included in:
Callback, Plugin
Defined in:
lib/cinch/helpers.rb

Instance Method Summary collapse

Instance Method Details

#Channel(*args) ⇒ Channel

Helper method for turning a String into a #Channel object.

Examples:

on :message, /^please join (#.+)$/ do |m, target|
  Channel(target).join
end

Parameters:

  • channel (String)

    a channel name

Returns:



8
9
10
# File 'lib/cinch/helpers.rb', line 8

def Channel(*args)
  @bot.Channel(*args)
end

#User(*args) ⇒ User

Helper method for turning a String into an #User object.

Examples:

on :message, /^tell me everything about (.+)$/ do |m, target|
  user = User(target)
  m.reply "%s is named %s and connects from %s" % [user.nick, user.name, user.host]
end

Parameters:

  • user (String)

    a user’s nickname

Returns:



17
18
19
# File 'lib/cinch/helpers.rb', line 17

def User(*args)
  @bot.User(*args)
end