Sha256: a2c1acc8d0b83c7e5dbf1d30bdd12d4d6c5a00cc77e8fd11edb25a361bee98af

Contents?: true

Size: 949 Bytes

Versions: 6

Compression:

Stored size: 949 Bytes

Contents

class SlackSmartBot

    # helpadmin: ----------------------------------------------
    # helpadmin: `update message URL TEXT`
    # helpadmin:    It will update the SmartBot message supplied
    # helpadmin:    You can use this command only if you are a Master admin user and if you are in a private conversation with the bot
    # helpadmin: command_id: :update_message
    # helpadmin:
    def update_message(from, typem, url, text)
      save_stats(__method__)
      channel, ts = url.scan(/\/archives\/(\w+)\/(\w\d+)/)[0]
      if config.masters.include?(from) and typem==:on_dm and !channel.nil? #master admin user
        ts = "#{ts[0..-7]}.#{ts[-6..-1]}"
        succ = update(channel, ts, text)
        if succ
          react :heavy_check_mark
        else
          react :x
        end
      else
        respond "Only master admin users on a private conversation with the SmartBot can update SmartBot messages"
      end
    end
end
  

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slack-smart-bot-1.14.2 lib/slack/smart-bot/commands/on_bot/admin_master/update_message.rb
slack-smart-bot-1.14.1 lib/slack/smart-bot/commands/on_bot/admin_master/update_message.rb
slack-smart-bot-1.14.0 lib/slack/smart-bot/commands/on_bot/admin_master/update_message.rb
slack-smart-bot-1.13.2 lib/slack/smart-bot/commands/on_bot/admin_master/update_message.rb
slack-smart-bot-1.13.1 lib/slack/smart-bot/commands/on_bot/admin_master/update_message.rb
slack-smart-bot-1.13.0 lib/slack/smart-bot/commands/on_bot/admin_master/update_message.rb