Sha256: 6f041f3982dd925cfdf5f8943647d79ed1077bc34f7ccdba73da6152e8a23e15

Contents?: true

Size: 590 Bytes

Versions: 1

Compression:

Stored size: 590 Bytes

Contents

module DiscordBot
  class Client
    # Channel module
    module Users
      # Message module
      module CreateChannel
        # Create message to channel
        def create_user_channel(recipient_id:)
          # define params for request
          body = { 'recipient_id' => recipient_id }.to_json
          headers = { 'Content-Type' => 'application/json', 'Authorization' => "Bot #{bot_token}", 'User-Agent' => user_agent }
          # make request
          self.class.post('/users/@me/channels', body: body, headers: headers).parsed_response
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discord_bot-0.2.0 lib/discord_bot/client/users/create_channel.rb