Sha256: 61b68ba0eb0a8c3e74f9e2d5ceaa54cafbbb5086ed50ccced5addd7c9c9f3fde

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

class SlackSmartBot

    # helpadmin: ----------------------------------------------
    # helpadmin: `send message to @USER_NAME : MESSAGE`
    # helpadmin: `send message to #CHANNEL_NAME : MESSAGE`
    # helpadmin: `send message to #CHANNEL_NAME THREAD_ID : MESSAGE`
    # helpadmin:    It will send the specified message as SmartBot
    # 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:
    def send_message(dest, from, typem, to, thread_ts, message)
      save_stats(__method__)
      if config.masters.include?(from) and typem==:on_dm #master admin user
        succ = (respond message, to, thread_ts: thread_ts, web_client: true)
        if succ
          react :heavy_check_mark
        else
          react :x
        end
      else
        respond "Only master admin users on a private conversation with the SmartBot can send messages as SmartBot.", dest
      end
    end
end
  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slack-smart-bot-1.10.0 lib/slack/smart-bot/commands/on_bot/admin_master/send_message.rb