Class: Foobara::DiscordApi::CreateMessage

Inherits:
Command
  • Object
show all
Includes:
HttpApiCommand
Defined in:
foobara-discord-api-0.0.3/src/create_message.rb

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Method Summary collapse

Methods inherited from Command

install!

Methods included from CommandPatternImplementation

install_state_machine_callback_methods

Methods included from TruncatedInspect

#inspect, truncating

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Method Details

#build_request_body ⇒ Object



22
23
24
# File 'src/create_message.rb', line 22

def build_request_body
  self.request_body = { content: }
end

#build_request_headers ⇒ Object



18
19
20
# File 'src/create_message.rb', line 18

def build_request_headers
  self.request_headers = { "Content-Type" => "application/json", "Authorization" => "Bot #{api_token}" }
end

#build_result ⇒ Object

Comment out this three lines when testing new models or looking for new attributes.



27
28
29
# File 'src/create_message.rb', line 27

def build_result
  Message.new(response_body, ignore_unexpected_attributes: true)
end