vbot 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vbot/bot_controller.rb +6 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 287c56b970ff91182775543f12eb1cbb70f79a0033d0f16ea2989e051a4aba18
|
4
|
+
data.tar.gz: 6fb2761d1d33ec26afec2fa16312a0b1cddfbac59aad70ea1d879930fa3fe3ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fab12de5db34aa68a8a6bd8740359ef9c7852f4c3e6e014180cb0aa68847de1a346000f9f7adc53c8c8344a4fbe8ae101aa1299da64b54228f99a9b74e2c748
|
7
|
+
data.tar.gz: 7d89ff73092ec841a8935f747c00b4f1fa52b4114fc203c060bf5c21b3afa74ded1062916f321434c5e12b8333a4eea14f751b2476dce5a734b328a1c57c9d9f
|
data/lib/vbot/bot_controller.rb
CHANGED
@@ -110,18 +110,18 @@ module Vbot
|
|
110
110
|
["JOIN #{@chan}\r\n"]
|
111
111
|
end
|
112
112
|
|
113
|
-
##
|
114
|
-
# Quits IRC server.
|
115
|
-
def quit_from_server
|
116
|
-
['QUIT']
|
117
|
-
end
|
118
|
-
|
119
113
|
##
|
120
114
|
# Handles ping message from server.
|
121
115
|
def handle_ping token
|
122
116
|
["PONG #{token}"]
|
123
117
|
end
|
124
118
|
|
119
|
+
##
|
120
|
+
# Quits IRC server.
|
121
|
+
def quit_from_server
|
122
|
+
['QUIT']
|
123
|
+
end
|
124
|
+
|
125
125
|
##
|
126
126
|
# Gets the nick to reply to.
|
127
127
|
def get_nick_rt(raw_rt)
|
@@ -150,22 +150,11 @@ module Vbot
|
|
150
150
|
}
|
151
151
|
end
|
152
152
|
|
153
|
-
##
|
154
|
-
# Executes command subroutines.
|
155
|
-
def exec_command_subroutine(command_hash)
|
156
|
-
if command_hash[:command].upcase == 'HOWDY' && command_hash[:pm] == true
|
157
|
-
["PRIVMSG #{command_hash[:reply_to]} :Howdy, #{command_hash[:reply_to]}.\r\n"]
|
158
|
-
elsif command_hash[:command].upcase == 'HOWDY' && command_hash[:pm] == false
|
159
|
-
["PRIVMSG #{@chan} :Howdy, #{command_hash[:reply_to]}.\r\n"]
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
153
|
##
|
164
154
|
# Performs logic on message to determine response.
|
165
155
|
def parse_message(data)
|
166
156
|
return handle_ping data[1] if data[0] == 'PING'
|
167
157
|
return join_to_channel if data[1] == '376' || data[1] == '422'
|
168
|
-
return exec_command_subroutine(interpret_command(data)) if data[1] == 'PRIVMSG' && (data[3] == ":#{@nick}" || data[3] == ':<>')
|
169
158
|
end
|
170
159
|
|
171
160
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'vbot is an IRC bot library that aims to be make building and extending
|
14
14
|
IRC bots more efficient.
|