<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.rage.mp/w/index.php?action=history&amp;feed=atom&amp;title=Discord%3A%3ArequestOAuth2</id>
	<title>Discord::requestOAuth2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rage.mp/w/index.php?action=history&amp;feed=atom&amp;title=Discord%3A%3ArequestOAuth2"/>
	<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Discord::requestOAuth2&amp;action=history"/>
	<updated>2026-07-21T21:32:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Discord::requestOAuth2&amp;diff=26869&amp;oldid=prev</id>
		<title>Shr0x: Created page with &quot;{{ClientsideJsFunction}} {{JSContainer| == Summary == Initiates an OAuth2 authorization flow for a specified Discord application. Returns a `Promise` resolving with an authorization code.  == Syntax == &lt;syntaxhighlight lang=&quot;javascript&quot;&gt; Promise&lt;string&gt; mp.discord.requestOAuth2(string applicationId); &lt;/syntaxhighlight&gt;  === Required Arguments === * &#039;&#039;&#039;applicationId:&#039;&#039;&#039; {{RageType|string}} - The Client ID of the Discord application.  === Return Value === * &#039;&#039;&#039;Promise&lt;stri...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Discord::requestOAuth2&amp;diff=26869&amp;oldid=prev"/>
		<updated>2024-11-24T19:24:31Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{ClientsideJsFunction}} {{JSContainer| == Summary == Initiates an OAuth2 authorization flow for a specified Discord application. Returns a `Promise` resolving with an authorization code.  == Syntax == &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; Promise&amp;lt;string&amp;gt; mp.discord.requestOAuth2(string applicationId); &amp;lt;/syntaxhighlight&amp;gt;  === Required Arguments === * &amp;#039;&amp;#039;&amp;#039;applicationId:&amp;#039;&amp;#039;&amp;#039; {{RageType|string}} - The Client ID of the Discord application.  === Return Value === * &amp;#039;&amp;#039;&amp;#039;Promise&amp;lt;stri...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{ClientsideJsFunction}}&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
== Summary ==&lt;br /&gt;
Initiates an OAuth2 authorization flow for a specified Discord application. Returns a `Promise` resolving with an authorization code.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
Promise&amp;lt;string&amp;gt; mp.discord.requestOAuth2(string applicationId);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required Arguments ===&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;applicationId:&amp;#039;&amp;#039;&amp;#039; {{RageType|string}} - The Client ID of the Discord application.&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Promise&amp;lt;string&amp;gt;:&amp;#039;&amp;#039;&amp;#039; Resolves with the authorization code upon user approval.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The following example requests an OAuth2 authorization code from a specified Discord application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mp.discord.requestOAuth2(&amp;quot;123456789012345678&amp;quot;)&lt;br /&gt;
    .then((authCode) =&amp;gt; {&lt;br /&gt;
        mp.gui.chat.push(`Authorization Code: ${authCode}`);&lt;br /&gt;
    })&lt;br /&gt;
    .catch((error) =&amp;gt; {&lt;br /&gt;
        mp.gui.chat.push(`Authorization request failed: ${error}`);&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
*[[Discord::update|mp.discord.update]]&lt;br /&gt;
*[[Discord::requestOAuth2|mp.discord.requestOAuth2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Clientside API]]&lt;br /&gt;
[[Category:Asynchronous Function]]&lt;/div&gt;</summary>
		<author><name>Shr0x</name></author>
	</entry>
</feed>