Sha256: cab96b24bc916dfe4e770b7adcfae1d648e3e1131e5f9a31526c09707b1808f3

Contents?: true

Size: 932 Bytes

Versions: 17

Compression:

Stored size: 932 Bytes

Contents

class SlackSmartBot

    # helpadmin: ----------------------------------------------
    # helpadmin: `delete message URL`
    # helpadmin:    It will delete 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: :delete_message
    # helpadmin:
    def delete_message(from, typem, url)
      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 = delete(channel, ts)
        if succ
          react :heavy_check_mark
        else
          react :x
        end
      else
        respond "Only master admin users on a private conversation with the SmartBot can delete SmartBot messages"
      end
    end
end
  

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
slack-smart-bot-1.14.2 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.14.1 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.14.0 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.13.2 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.13.1 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.13.0 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.9 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.8 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.7 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.6 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.5 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.4 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.3 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.2 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.1 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.12.0 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb
slack-smart-bot-1.11.0 lib/slack/smart-bot/commands/on_bot/admin_master/delete_message.rb