class SlackbotFrd::SlackMethods::ChatDelete

Public Class Methods

delete(token:, channel:, timestamp:) click to toggle source
# File lib/slackbot_frd/slack_methods/chat_delete.rb, line 10
def self.delete(token:, channel:, timestamp:)
  r = ChatDelete.new(token: token, channel: channel, timestamp: timestamp)
  r.delete
end
new(token:, channel:, timestamp:) click to toggle source
# File lib/slackbot_frd/slack_methods/chat_delete.rb, line 15
def initialize(token:, channel:, timestamp:)
  @token = token
  @channel = channel
  @timestamp = timestamp
end

Public Instance Methods

delete() click to toggle source
# File lib/slackbot_frd/slack_methods/chat_delete.rb, line 21
def delete
  body = {
    token: @token,
    channel: @channel,
    ts: @timestamp,
  }

  @response = self.class.post('', :body => body)
  ValidateSlack.response(@response)
  @response
end