Exception: MijDiscord::Errors::MessageTooLong
- Inherits:
-
DiscordError
- Object
- RuntimeError
- DiscordError
- MijDiscord::Errors::MessageTooLong
- Defined in:
- lib/mij-discord/errors.rb
Constant Summary collapse
- MATCH_PATTERNS =
[['2000'], ['long', 'length', 'size'], ['fewer', 'maximum']]
Instance Attribute Summary
Attributes inherited from DiscordError
Class Method Summary collapse
-
.match_pattern?(error) ⇒ Boolean
This is shitcode.
Instance Method Summary collapse
-
#initialize(message, response) ⇒ MessageTooLong
constructor
A new instance of MessageTooLong.
Constructor Details
#initialize(message, response) ⇒ MessageTooLong
Returns a new instance of MessageTooLong.
25 26 27 |
# File 'lib/mij-discord/errors.rb', line 25 def initialize(, response) super(nil, , response) end |
Class Method Details
.match_pattern?(error) ⇒ Boolean
This is shitcode
20 21 22 23 |
# File 'lib/mij-discord/errors.rb', line 20 def self.match_pattern?(error) return false if error.nil? MATCH_PATTERNS.reduce(true) {|a,x| a && x.reduce(false) {|b,y| b || error.include?(y) } } end |