mod_spox 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/INSTALL +9 -0
- data/README +33 -0
- data/bin/mod_spox +60 -0
- data/data/mod_spox/extras/Tester.rb +14 -0
- data/data/mod_spox/plugins/Authenticator.rb +245 -0
- data/data/mod_spox/plugins/BotNick.rb +18 -0
- data/data/mod_spox/plugins/Initializer.rb +41 -0
- data/data/mod_spox/plugins/Joiner.rb +13 -0
- data/data/mod_spox/plugins/Parter.rb +22 -0
- data/data/mod_spox/plugins/PluginLoader.rb +136 -0
- data/data/mod_spox/plugins/Ponger.rb +14 -0
- data/data/mod_spox/plugins/Quitter.rb +14 -0
- data/lib/mod_spox/Action.rb +73 -0
- data/lib/mod_spox/BaseConfig.rb +48 -0
- data/lib/mod_spox/Bot.rb +472 -0
- data/lib/mod_spox/BotConfig.rb +54 -0
- data/lib/mod_spox/ConfigurationWizard.rb +178 -0
- data/lib/mod_spox/Database.rb +25 -0
- data/lib/mod_spox/Exceptions.rb +35 -0
- data/lib/mod_spox/Helpers.rb +35 -0
- data/lib/mod_spox/Loader.rb +79 -0
- data/lib/mod_spox/Logger.rb +31 -0
- data/lib/mod_spox/MessageFactory.rb +73 -0
- data/lib/mod_spox/Monitors.rb +59 -0
- data/lib/mod_spox/Pipeline.rb +148 -0
- data/lib/mod_spox/Plugin.rb +18 -0
- data/lib/mod_spox/PluginManager.rb +105 -0
- data/lib/mod_spox/Pool.rb +50 -0
- data/lib/mod_spox/Socket.rb +171 -0
- data/lib/mod_spox/Timer.rb +138 -0
- data/lib/mod_spox/handlers/BadNick.rb +16 -0
- data/lib/mod_spox/handlers/Bounce.rb +15 -0
- data/lib/mod_spox/handlers/Created.rb +16 -0
- data/lib/mod_spox/handlers/Handler.rb +31 -0
- data/lib/mod_spox/handlers/Invite.rb +19 -0
- data/lib/mod_spox/handlers/Join.rb +30 -0
- data/lib/mod_spox/handlers/Kick.rb +24 -0
- data/lib/mod_spox/handlers/LuserChannels.rb +16 -0
- data/lib/mod_spox/handlers/LuserClient.rb +16 -0
- data/lib/mod_spox/handlers/LuserMe.rb +14 -0
- data/lib/mod_spox/handlers/LuserOp.rb +16 -0
- data/lib/mod_spox/handlers/LuserUnknown.rb +16 -0
- data/lib/mod_spox/handlers/Mode.rb +47 -0
- data/lib/mod_spox/handlers/Motd.rb +30 -0
- data/lib/mod_spox/handlers/MyInfo.rb +21 -0
- data/lib/mod_spox/handlers/Names.rb +54 -0
- data/lib/mod_spox/handlers/Nick.rb +24 -0
- data/lib/mod_spox/handlers/NickInUse.rb +16 -0
- data/lib/mod_spox/handlers/Notice.rb +32 -0
- data/lib/mod_spox/handlers/Part.rb +19 -0
- data/lib/mod_spox/handlers/Ping.rb +16 -0
- data/lib/mod_spox/handlers/Pong.rb +16 -0
- data/lib/mod_spox/handlers/Privmsg.rb +27 -0
- data/lib/mod_spox/handlers/Quit.rb +21 -0
- data/lib/mod_spox/handlers/Topic.rb +29 -0
- data/lib/mod_spox/handlers/Welcome.rb +34 -0
- data/lib/mod_spox/handlers/Who.rb +60 -0
- data/lib/mod_spox/handlers/Whois.rb +63 -0
- data/lib/mod_spox/handlers/YourHost.rb +17 -0
- data/lib/mod_spox/messages/incoming/BadNick.rb +15 -0
- data/lib/mod_spox/messages/incoming/Bounce.rb +17 -0
- data/lib/mod_spox/messages/incoming/Created.rb +14 -0
- data/lib/mod_spox/messages/incoming/Invite.rb +20 -0
- data/lib/mod_spox/messages/incoming/Join.rb +18 -0
- data/lib/mod_spox/messages/incoming/Kick.rb +25 -0
- data/lib/mod_spox/messages/incoming/LuserChannels.rb +14 -0
- data/lib/mod_spox/messages/incoming/LuserClient.rb +23 -0
- data/lib/mod_spox/messages/incoming/LuserMe.rb +17 -0
- data/lib/mod_spox/messages/incoming/LuserOp.rb +14 -0
- data/lib/mod_spox/messages/incoming/LuserUnknown.rb +14 -0
- data/lib/mod_spox/messages/incoming/Message.rb +22 -0
- data/lib/mod_spox/messages/incoming/Mode.rb +41 -0
- data/lib/mod_spox/messages/incoming/Motd.rb +17 -0
- data/lib/mod_spox/messages/incoming/MyInfo.rb +23 -0
- data/lib/mod_spox/messages/incoming/Names.rb +23 -0
- data/lib/mod_spox/messages/incoming/Nick.rb +25 -0
- data/lib/mod_spox/messages/incoming/NickInUse.rb +14 -0
- data/lib/mod_spox/messages/incoming/Notice.rb +8 -0
- data/lib/mod_spox/messages/incoming/Part.rb +20 -0
- data/lib/mod_spox/messages/incoming/Ping.rb +17 -0
- data/lib/mod_spox/messages/incoming/Pong.rb +8 -0
- data/lib/mod_spox/messages/incoming/Privmsg.rb +64 -0
- data/lib/mod_spox/messages/incoming/Quit.rb +17 -0
- data/lib/mod_spox/messages/incoming/Topic.rb +20 -0
- data/lib/mod_spox/messages/incoming/TopicInfo.rb +20 -0
- data/lib/mod_spox/messages/incoming/Welcome.rb +26 -0
- data/lib/mod_spox/messages/incoming/Who.rb +17 -0
- data/lib/mod_spox/messages/incoming/Whois.rb +47 -0
- data/lib/mod_spox/messages/incoming/YourHost.rb +17 -0
- data/lib/mod_spox/messages/internal/BotInitialized.rb +11 -0
- data/lib/mod_spox/messages/internal/ChangeNick.rb +15 -0
- data/lib/mod_spox/messages/internal/Connected.rb +20 -0
- data/lib/mod_spox/messages/internal/ConnectionFailed.rb +23 -0
- data/lib/mod_spox/messages/internal/Disconnected.rb +8 -0
- data/lib/mod_spox/messages/internal/Disconnecting.rb +8 -0
- data/lib/mod_spox/messages/internal/EstablishConnection.rb +22 -0
- data/lib/mod_spox/messages/internal/HaltBot.rb +8 -0
- data/lib/mod_spox/messages/internal/NickRequest.rb +8 -0
- data/lib/mod_spox/messages/internal/NickResponse.rb +14 -0
- data/lib/mod_spox/messages/internal/PluginLoadRequest.rb +20 -0
- data/lib/mod_spox/messages/internal/PluginLoadResponse.rb +16 -0
- data/lib/mod_spox/messages/internal/PluginModuleRequest.rb +13 -0
- data/lib/mod_spox/messages/internal/PluginModuleResponse.rb +17 -0
- data/lib/mod_spox/messages/internal/PluginReload.rb +8 -0
- data/lib/mod_spox/messages/internal/PluginRequest.rb +17 -0
- data/lib/mod_spox/messages/internal/PluginResponse.rb +20 -0
- data/lib/mod_spox/messages/internal/PluginUnloadRequest.rb +8 -0
- data/lib/mod_spox/messages/internal/PluginUnloadResponse.rb +8 -0
- data/lib/mod_spox/messages/internal/Request.rb +15 -0
- data/lib/mod_spox/messages/internal/Response.rb +15 -0
- data/lib/mod_spox/messages/internal/Shutdown.rb +8 -0
- data/lib/mod_spox/messages/internal/SignaturesUpdate.rb +8 -0
- data/lib/mod_spox/messages/internal/StatusRequest.rb +9 -0
- data/lib/mod_spox/messages/internal/StatusResponse.rb +17 -0
- data/lib/mod_spox/messages/internal/TimerAdd.rb +27 -0
- data/lib/mod_spox/messages/internal/TimerClear.rb +8 -0
- data/lib/mod_spox/messages/internal/TimerRemove.rb +15 -0
- data/lib/mod_spox/messages/internal/TimerResponse.rb +26 -0
- data/lib/mod_spox/messages/internal/TriggersUpdate.rb +8 -0
- data/lib/mod_spox/messages/outgoing/Admin.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Away.rb +10 -0
- data/lib/mod_spox/messages/outgoing/ChannelMode.rb +25 -0
- data/lib/mod_spox/messages/outgoing/Connect.rb +24 -0
- data/lib/mod_spox/messages/outgoing/Die.rb +9 -0
- data/lib/mod_spox/messages/outgoing/Info.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Invite.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Ison.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Join.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Kick.rb +23 -0
- data/lib/mod_spox/messages/outgoing/Kill.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Links.rb +19 -0
- data/lib/mod_spox/messages/outgoing/List.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Lusers.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Motd.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Names.rb +20 -0
- data/lib/mod_spox/messages/outgoing/Nick.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Notice.rb +11 -0
- data/lib/mod_spox/messages/outgoing/Oper.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Part.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Pass.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Ping.rb +10 -0
- data/lib/mod_spox/messages/outgoing/Pong.rb +17 -0
- data/lib/mod_spox/messages/outgoing/Privmsg.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Quit.rb +10 -0
- data/lib/mod_spox/messages/outgoing/Rehash.rb +9 -0
- data/lib/mod_spox/messages/outgoing/Restart.rb +9 -0
- data/lib/mod_spox/messages/outgoing/ServList.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Simple.rb +12 -0
- data/lib/mod_spox/messages/outgoing/Squery.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Squit.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Stats.rb +18 -0
- data/lib/mod_spox/messages/outgoing/Summon.rb +23 -0
- data/lib/mod_spox/messages/outgoing/Time.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Topic.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Trace.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Unaway.rb +9 -0
- data/lib/mod_spox/messages/outgoing/User.rb +23 -0
- data/lib/mod_spox/messages/outgoing/UserHost.rb +15 -0
- data/lib/mod_spox/messages/outgoing/UserMode.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Users.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Version.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Who.rb +19 -0
- data/lib/mod_spox/messages/outgoing/WhoWas.rb +23 -0
- data/lib/mod_spox/messages/outgoing/Whois.rb +19 -0
- data/lib/mod_spox/migration/001_create_auths.rb +13 -0
- data/lib/mod_spox/migration/001_create_channel.rb +13 -0
- data/lib/mod_spox/migration/001_create_channel_modes.rb +13 -0
- data/lib/mod_spox/migration/001_create_config.rb +13 -0
- data/lib/mod_spox/migration/001_create_nick_channels.rb +13 -0
- data/lib/mod_spox/migration/001_create_nick_modes.rb +13 -0
- data/lib/mod_spox/migration/001_create_nicks.rb +13 -0
- data/lib/mod_spox/migration/001_create_servers.rb +13 -0
- data/lib/mod_spox/migration/001_create_settings.rb +13 -0
- data/lib/mod_spox/migration/001_create_signatures.rb +13 -0
- data/lib/mod_spox/migration/001_create_triggers.rb +13 -0
- data/lib/mod_spox/models/Auth.rb +79 -0
- data/lib/mod_spox/models/AuthGroup.rb +15 -0
- data/lib/mod_spox/models/Channel.rb +47 -0
- data/lib/mod_spox/models/ChannelMode.rb +14 -0
- data/lib/mod_spox/models/Config.rb +31 -0
- data/lib/mod_spox/models/Group.rb +13 -0
- data/lib/mod_spox/models/Nick.rb +110 -0
- data/lib/mod_spox/models/NickChannel.rb +43 -0
- data/lib/mod_spox/models/NickMode.rb +18 -0
- data/lib/mod_spox/models/Server.rb +12 -0
- data/lib/mod_spox/models/Setting.rb +40 -0
- data/lib/mod_spox/models/Signature.rb +30 -0
- data/lib/mod_spox/models/Trigger.rb +9 -0
- data/lib/mod_spox/rfc2812.rb +171 -0
- metadata +261 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Names
|
5
|
+
# nick to invite
|
6
|
+
attr_reader :nick
|
7
|
+
# channel to invite nick to
|
8
|
+
attr_reader :channel
|
9
|
+
# nick:: nick to invite
|
10
|
+
# channel:: channel to invite nick into
|
11
|
+
# Invite user into a channel
|
12
|
+
def initialize(nick, channel)
|
13
|
+
@nick = nick
|
14
|
+
@channel = channel
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Join
|
5
|
+
# channel to join
|
6
|
+
attr_reader :channel
|
7
|
+
# key for channel
|
8
|
+
attr_reader :key
|
9
|
+
# channel:: channel to join
|
10
|
+
# key:: channel key if needed
|
11
|
+
# Join the channel. This command only allows single joins.
|
12
|
+
def initialize(channel, key=nil)
|
13
|
+
@channel = channel
|
14
|
+
@key = key
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Kick
|
5
|
+
# nick of user to kick
|
6
|
+
attr_reader :nick
|
7
|
+
# channel to kick user out of
|
8
|
+
attr_reader :channel
|
9
|
+
# reason for kick
|
10
|
+
attr_reader :reason
|
11
|
+
# nick:: nick of user to kick
|
12
|
+
# channel:: channel to kick user out of
|
13
|
+
# reason:: reason for kick
|
14
|
+
# Request the forced removal of a user from a channel
|
15
|
+
def initialize(nick, channel, reason=nil)
|
16
|
+
@nick = nick
|
17
|
+
@channel = channel
|
18
|
+
@reason = reason
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Kill
|
5
|
+
# nick to kill
|
6
|
+
attr_reader :nick
|
7
|
+
# reason for kill
|
8
|
+
attr_reader :comment
|
9
|
+
# nick:: nick to kill
|
10
|
+
# comment:: comment about kill
|
11
|
+
# Kill connection between given nick and server
|
12
|
+
def initialize(nick, comment)
|
13
|
+
@nick = nick
|
14
|
+
@comment = comment
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Links
|
5
|
+
# remote server
|
6
|
+
attr_reader :server
|
7
|
+
# server mask
|
8
|
+
attr_reader :mask
|
9
|
+
# server:: remote server
|
10
|
+
# mask:: server mask
|
11
|
+
# List all servernames known by the server answering the query
|
12
|
+
def initialize(server, mask)
|
13
|
+
@server = server
|
14
|
+
@mask = mask
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class List
|
5
|
+
# channel to list
|
6
|
+
attr_reader :channel
|
7
|
+
# server to forward request to
|
8
|
+
attr_reader :target
|
9
|
+
# channel:: channel to list
|
10
|
+
# target:: forward to this server to supply response
|
11
|
+
# List channels and their topics
|
12
|
+
def initialize(channel, target='')
|
13
|
+
@channel = channel
|
14
|
+
@target = target
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Lusers
|
5
|
+
# mask for servers to match
|
6
|
+
attr_reader :mask
|
7
|
+
# reply from target server
|
8
|
+
attr_reader :target
|
9
|
+
# mask:: reply formed only by servers matching given mask
|
10
|
+
# target:: reply formed only by target server
|
11
|
+
# Get statistics about size of IRC network
|
12
|
+
def initialize(mask, target='')
|
13
|
+
@mask = mask
|
14
|
+
@target = target
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Motd
|
5
|
+
# server to send request to
|
6
|
+
attr_reader :target
|
7
|
+
# target:: server to send request to
|
8
|
+
# Request MOTD from target server. If no target is given
|
9
|
+
# it requests from the current server
|
10
|
+
def initialize(target='')
|
11
|
+
@target = target
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Names
|
5
|
+
# channel to request names
|
6
|
+
attr_reader :channel
|
7
|
+
# server to forward request to
|
8
|
+
attr_reader :target
|
9
|
+
# channel:: channel to request names from
|
10
|
+
# target:: forward to this server to supply response
|
11
|
+
# List visible nicknames. Supply empty string for channel
|
12
|
+
# to get entire list
|
13
|
+
def initialize(channel, target='')
|
14
|
+
@channel = channel
|
15
|
+
@target = target
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Oper
|
5
|
+
# login name
|
6
|
+
attr_reader :name
|
7
|
+
# user's password
|
8
|
+
attr_reader :password
|
9
|
+
# name:: login name
|
10
|
+
# password:: user's password
|
11
|
+
# Create new Oper message
|
12
|
+
def initialize(name, password)
|
13
|
+
@name = name
|
14
|
+
@password = password
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Part
|
5
|
+
# channel to part
|
6
|
+
attr_reader :channel
|
7
|
+
# reason for part
|
8
|
+
attr_reader :reason
|
9
|
+
# channel:: channel to part
|
10
|
+
# reason:: reason for part
|
11
|
+
# Part from channel. This command only allows single parts.
|
12
|
+
def initialize(channel, reason='')
|
13
|
+
@channel = channel
|
14
|
+
@reason = reason
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
# Send PASS command
|
5
|
+
class Pass
|
6
|
+
# connection password
|
7
|
+
attr_reader :password
|
8
|
+
# password:: connection password
|
9
|
+
# Create new Pass
|
10
|
+
def initialize(password)
|
11
|
+
@password = @message
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Pong
|
5
|
+
# server:: server to send to
|
6
|
+
attr_reader :server
|
7
|
+
# string:: string
|
8
|
+
attr_reader :string
|
9
|
+
# Send a pong
|
10
|
+
def initialize(server, string)
|
11
|
+
@server = server
|
12
|
+
@string = string
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Privmsg
|
5
|
+
# target for the message
|
6
|
+
attr_reader :target
|
7
|
+
# the message
|
8
|
+
attr_reader :message
|
9
|
+
# target:: target for the message
|
10
|
+
# message:: message to be sent
|
11
|
+
# Send a message to user or channel
|
12
|
+
def initialize(target, message)
|
13
|
+
@target = target
|
14
|
+
@message = message
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class ServList
|
5
|
+
# mask
|
6
|
+
attr_reader :mask
|
7
|
+
# type
|
8
|
+
attr_reader :type
|
9
|
+
# mask:: mask
|
10
|
+
# type:: type
|
11
|
+
# List services currently connected to network
|
12
|
+
def initialize(mask, type)
|
13
|
+
@mask = mask
|
14
|
+
@type = type
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Squery
|
5
|
+
# service to query
|
6
|
+
attr_reader :service_name
|
7
|
+
# message to send to service
|
8
|
+
attr_reader :message
|
9
|
+
# service_name:: name of the service to query
|
10
|
+
# message:: message to send to service
|
11
|
+
# Send message to a service
|
12
|
+
def initialize(service_name, message)
|
13
|
+
@service_name = service_name
|
14
|
+
@message = message
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Squit
|
5
|
+
# server to disconnect
|
6
|
+
attr_reader :server
|
7
|
+
# reasone for disconnection
|
8
|
+
attr_reader :comment
|
9
|
+
# server:: server to disconnect
|
10
|
+
# comment:: reason for disconnection
|
11
|
+
# Disconnect server link. Only available if bot is oper.
|
12
|
+
def initialize(server, comment)
|
13
|
+
@comment = comment
|
14
|
+
@server = server
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Stats
|
5
|
+
# the query
|
6
|
+
attr_reader :query
|
7
|
+
# target server
|
8
|
+
attr_reader :target
|
9
|
+
# query:: single character for query
|
10
|
+
# target:: target server to query (or connected server if unset)
|
11
|
+
def initialize(query, target='')
|
12
|
+
@query = query
|
13
|
+
@target = target
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Summon
|
5
|
+
# nick to summon
|
6
|
+
attr_reader :nick
|
7
|
+
# server nick is on
|
8
|
+
attr_reader :target
|
9
|
+
# channel to summon to
|
10
|
+
attr_reader :channel
|
11
|
+
# nick:: nick to summon
|
12
|
+
# target:: server which nick is on
|
13
|
+
# channel:: channel to summon to
|
14
|
+
# Summon a user
|
15
|
+
def initialize(nick, target='', channel='')
|
16
|
+
@nick = nick
|
17
|
+
@channel = channel
|
18
|
+
@target = target
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Topic
|
5
|
+
# channel to set topic
|
6
|
+
attr_reader :channel
|
7
|
+
# the topic
|
8
|
+
attr_reader :topic
|
9
|
+
# channel:: channel to set topic in
|
10
|
+
# topic:: the topic
|
11
|
+
# Set the topic for the channel
|
12
|
+
def initialize(channel, topic)
|
13
|
+
@channel = channel
|
14
|
+
@topic = topic
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Trace
|
5
|
+
# target to trace to
|
6
|
+
attr_reader :target
|
7
|
+
# target:: target to trace to
|
8
|
+
# Find route to specifc server
|
9
|
+
def initialize(target)
|
10
|
+
@target = target
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class User
|
5
|
+
# username of user
|
6
|
+
attr_reader :username
|
7
|
+
# real name of user
|
8
|
+
attr_reader :real_name
|
9
|
+
# mode of user
|
10
|
+
attr_reader :mode
|
11
|
+
# username:: username of user
|
12
|
+
# real_name:: real name of user
|
13
|
+
# mode:: default mode (see RFC 2812 for proper mode values)
|
14
|
+
# Create new User message
|
15
|
+
def initialize(username, real_name, mode=0)
|
16
|
+
@username = username
|
17
|
+
@real_name = real_name
|
18
|
+
@mode = mode
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class UserMode
|
5
|
+
# The bot's nick
|
6
|
+
attr_reader :nick
|
7
|
+
# mode to set/unset
|
8
|
+
attr_reader :mode
|
9
|
+
# nick:: The bot's nick
|
10
|
+
# mode:: mode to set/unset
|
11
|
+
# Create UserMode message
|
12
|
+
def initialize(nick, mode)
|
13
|
+
@nick = nick
|
14
|
+
@mode = mode
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Version
|
5
|
+
# target server to query
|
6
|
+
attr_reader :target
|
7
|
+
# target:: target server to query
|
8
|
+
# Query version of server. Connected server is queried
|
9
|
+
# if target is not defined
|
10
|
+
def initialize(target='')
|
11
|
+
@target = target
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
class Who
|
5
|
+
# mask to match
|
6
|
+
attr_reader :mask
|
7
|
+
# return only ops
|
8
|
+
attr_reader :op_only
|
9
|
+
# mask:: mask of clients to match
|
10
|
+
# only_ops:: only return operators
|
11
|
+
# Query for information matching given mask
|
12
|
+
def initialize(mask, op_only=false)
|
13
|
+
@mask = mask
|
14
|
+
@op_only = op_only
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|