class Crirc::Controller::Client

Included Modules

Defined in:

crirc/controller/client.cr

Constructors

Instance Method Summary

Instance methods inherited from module Crirc::Binding::Handler

docs : Hash(String, String) docs, handle(msg : String)
handle(msg : Crirc::Protocol::Message)
handle
, hooks : Hash(Trigger, Array(Hook)) hooks, on(command : String = "PRIVMSG", source : HookRule = nil, arguments : HookRule = nil, message : HookRule = nil, doc : Tuple(String, String)? = nil, &hook : Hook) on

Constructor methods inherited from module Crirc::Binding::Handler

new(**opts) new

Instance methods inherited from module Crirc::Controller::Controller

gets gets, puts(data) puts

Instance methods inherited from module Crirc::Controller::Command::Chan

invite(chan : Crirc::Protocol::Chan, user : Crirc::Protocol::User) invite, join(chans : Enumerable(Crirc::Protocol::Chan), passwords : Enumerable(String) = [""])
join(chan : Crirc::Protocol::Chan, password : String = "")
join
, kick(chans : Enumerable(Crirc::Protocol::Chan), users : Enumerable(Crirc::Protocol::User), msg : String? = nil)
kick(chans : Enumerable(Crirc::Protocol::Chan), user : Crirc::Protocol::User, msg : String? = nil)
kick(chan : Crirc::Protocol::Chan, users : Enumerable(Crirc::Protocol::User), msg : String? = nil)
kick(chan : Crirc::Protocol::Chan, user : Crirc::Protocol::User, msg : String? = nil)
kick
, list(chans : Enumerable(Crirc::Protocol::Chan?)?)
list(chan : Crirc::Protocol::Chan)
list
, mode(chan : Crirc::Protocol::Chan, flags : String, user : Crirc::Protocol::User? = nil) mode, names(chans : Enumerable(Crirc::Protocol::Chan)?)
names(chan : Crirc::Protocol::Chan)
names
, part(chans : Enumerable(Crirc::Protocol::Chan), msg : String? = nil)
part(chan : Crirc::Protocol::Chan, msg : String? = nil)
part
, topic(chan : Crirc::Protocol::Chan, msg : String? = nil) topic

Instance methods inherited from module Crirc::Controller::Command

puts(data) puts

Instance methods inherited from module Crirc::Controller::Command::Talk

notice(target : Crirc::Protocol::Target, msg : String) notice, privmsg(target : Crirc::Protocol::Target, msg : String) privmsg

Instance methods inherited from module Crirc::Controller::Command

puts(data) puts

Instance methods inherited from module Crirc::Controller::Command::User

mode(target : Crirc::Protocol::Target, flags : String) mode, whois(target : Crirc::Protocol::Target) whois, whowas(target : Crirc::Protocol::Target) whowas

Instance methods inherited from module Crirc::Controller::Command

puts(data) puts

Instance methods inherited from module Crirc::Controller::Command::Ping

ping(msg : String? = "0") ping, pong(msg : String? = "0") pong

Instance methods inherited from module Crirc::Controller::Command

puts(data) puts

Constructor Detail

def self.new(network) #

New Client that controls the given Network.


[View source]

Instance Method Detail

def chanlist : ChanList #

TODO Not used yet


[View source]
def gets(*args, **options) #

delegated to the Network


[View source]
def gets(*args, **options, &) #

delegated to the Network


[View source]
def init #

Initialize the connection with the IRC server (send pass, nick and user).


[View source]
def network : Network::Client #

[View source]
def nick(*args, **options) #

delegated to the Network


[View source]
def nick(*args, **options, &) #

delegated to the Network


[View source]
def on_ready(&b) : Client #

Start the callback when the server is ready to receive messages.

bot.on_ready do
  amazing_stuff(bot)
end

[View source]
def puts(*args, **options) #

delegated to the Network


[View source]
def puts(*args, **options, &) #

delegated to the Network


[View source]
def reply(msg, data) #

Reply to a given message with a privmsg.

bot.on("JOIN") do |msg, UNDERSCORE|
  nick = msg.source.source_nick
  context.reply(msg, "Welcome to #{nick}")
end

[View source]