Try not to explode violently in some weird scenarios
This commit is contained in:
parent
4973d83165
commit
eac7543bfe
1 changed files with 11 additions and 6 deletions
|
@ -58,12 +58,17 @@ Client.register_trigger("PRIVMSG") { |msg|
|
|||
command = message.split[1]
|
||||
arguments = message.split[2..-1]
|
||||
else
|
||||
# did the message start with a :?
|
||||
# If so, use everything after ":" from the first word as a command and
|
||||
# all the other words as arguments array
|
||||
if message.split.first[0] == ":" then
|
||||
command = message.split.first[1..-1]
|
||||
arguments = message.split[1..-1]
|
||||
if not message.split.first.nil? then
|
||||
# did the message start with a :?
|
||||
# If so, use everything after ":" from the first word as a command and
|
||||
# all the other words as arguments array
|
||||
if message.split.first[0] == ":" then
|
||||
command = message.split.first[1..-1]
|
||||
arguments = message.split[1..-1]
|
||||
end
|
||||
else
|
||||
command = ""
|
||||
arguments = ""
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue