Websites/app/logical/discord_link.rb

11 lines
365 B
Ruby
Raw Normal View History

2024-05-03 03:04:43 +00:00
# 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