<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=TActivePlayer.RequestDiscordToken</id>
		<title>TActivePlayer.RequestDiscordToken - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=TActivePlayer.RequestDiscordToken"/>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TActivePlayer.RequestDiscordToken&amp;action=history"/>
		<updated>2026-05-26T01:28:17Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.soldat.pl/index.php?title=TActivePlayer.RequestDiscordToken&amp;diff=3225&amp;oldid=prev</id>
		<title>H: Created page with &quot; '''''procedure RequestDiscordToken''''' ==Description== Sends a request to retrieve player's discord OAuth2 token, on a successful call server will receive a /discord_token c...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TActivePlayer.RequestDiscordToken&amp;diff=3225&amp;oldid=prev"/>
				<updated>2020-05-06T21:38:57Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;procedure RequestDiscordToken&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; ==Description== Sends a request to retrieve player&amp;#039;s discord OAuth2 token, on a successful call server will receive a /discord_token c...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; '''''procedure RequestDiscordToken'''''&lt;br /&gt;
==Description==&lt;br /&gt;
Sends a request to retrieve player's discord OAuth2 token, on a successful call server will receive a /discord_token command with the token.&lt;br /&gt;
&lt;br /&gt;
This request works only on players who are using the desktop version of Discord.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
procedure OnJoin(Player: TActivePlayer; Team: TTeam);&lt;br /&gt;
begin&lt;br /&gt;
   Player.RequestDiscordToken;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
function OnCommand(Player: TActivePlayer; Command: string): Boolean;&lt;br /&gt;
var&lt;br /&gt;
  Token: String;&lt;br /&gt;
begin&lt;br /&gt;
  if Copy(Command, 1, 15) = '/discord_token ' then&lt;br /&gt;
  begin&lt;br /&gt;
    Token := Copy(Command, 16, Length(Command));&lt;br /&gt;
    // Use 3rdparty library to call and parse response from discord api&lt;br /&gt;
    // Curl bash example: curl -H 'Authorization: Bearer TOKEN' https://discordapp.com/api/users/@me&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var &lt;br /&gt;
  i: Byte;&lt;br /&gt;
begin&lt;br /&gt;
  Game.OnJoin := @OnJoin;&lt;br /&gt;
  for i:=1 to 32 do&lt;br /&gt;
    Players[i].OnCommand := @OnCommand;&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:TActivePlayer]]&lt;/div&gt;</summary>
		<author><name>H</name></author>	</entry>

	</feed>