Class ::BasicUserMessage
In: lib/rbot/core/utils/extends.rb
Parent: Object
User HTTPResponse BasicUserMessage Bot\n[lib/rbot/core/remote.rb\nlib/rbot/core/utils/extends.rb\nlib/rbot/core/utils/filters.rb\nlib/rbot/core/utils/wordlist.rb] HttpUtil lib/rbot/core/userdata.rb lib/rbot/core/utils/httputil.rb lib/rbot/core/utils/extends.rb lib/rbot/core/remote.rb lib/rbot/core/utils/httputil.rb ParseTime Utils (null) dot/m_15_0.png

Methods

Public Instance methods

We extend the BasicUserMessage class with a method that parses a string which is a channel list as matched by IN_CHAN(_LIST) and co. The method returns an array of channel names, where ‘private’ or ‘pvt’ is replaced by the Symbol :"?", ‘here’ is replaced by the channel of the message or by :"?" (depending on whether the message target is the bot or a Channel), and ‘anywhere’ and ‘everywhere’ are replaced by Symbol :*

[Source]

     # File lib/rbot/core/utils/extends.rb, line 421
421:     def parse_channel_list(string)
422:       return [:*] if [:anywhere, :everywhere].include? string.to_sym
423:       string.scan(
424:       /(?:^|,?(?:\s+and)?\s+)(?:in|on\s+)?(#{Regexp::Irc::GEN_CHAN}|here|private|pvt)/
425:                  ).map { |chan_ar|
426:         chan = chan_ar.first
427:         case chan.to_sym
428:         when :private, :pvt
429:           "?""?"
430:         when :here
431:           case self.target
432:           when Channel
433:             self.target.name
434:           else
435:             "?""?"
436:           end
437:         else
438:           chan
439:         end
440:       }.uniq
441:     end

The recurse depth of a message, for fake messages. 0 means an original message

[Source]

     # File lib/rbot/core/utils/extends.rb, line 445
445:     def recurse_depth
446:       unless defined? @recurse_depth
447:         @recurse_depth = 0
448:       end
449:       @recurse_depth
450:     end

Set the recurse depth of a message, for fake messages. 0 should only be used by original messages

[Source]

     # File lib/rbot/core/utils/extends.rb, line 454
454:     def recurse_depth=(val)
455:       @recurse_depth = val
456:     end

[Validate]