Class: Teems::Commands::Messages

Inherits:
Base
  • Object
show all
Includes:
AttachmentDownload, MessagesDisplay
Defined in:
lib/teems/commands/messages.rb

Overview

Read messages from a channel or chat

Constant Summary

Constants included from MessagesDisplay

Teems::Commands::MessagesDisplay::REACTION_EMOJI

Instance Attribute Summary

Attributes inherited from Base

#options, #positional_args, #runner

Instance Method Summary collapse

Constructor Details

#initialize(args, runner:) ⇒ Messages

Returns a new instance of Messages.



175
176
177
178
# File 'lib/teems/commands/messages.rb', line 175

def initialize(args, runner:)
  @options = {}
  super
end

Instance Method Details

#executeObject



180
181
182
183
184
185
186
# File 'lib/teems/commands/messages.rb', line 180

def execute
  result = validate_options || require_auth
  return result if result

  target = resolve_target
  target ? fetch_messages(target) : 1
end