# frozen_string_literal: true module DiscordLink module_function def for(client_id:, redirect_uri:, scope:, response_type: "code") params = %W[client_id=#{client_id} redirect_uri=#{CGI.escape(redirect_uri)} response_type=#{response_type} scope=#{scope.join('%20')} prompt=none] "https://discord.com/api/oauth2/authorize?#{params.join('&')}" end end