Integrate free adrenaline with discord

The feature below lets you send as many Discord webhooks as you want. It also works with the free version of Adrenaline. Steps:

  • Create your own webhook url in your discord server.,
  • Place the Discord.pas file in the same folder as your main script.,
  • Open Discord.pas with a notepad and change the variable: const WebhookURL = 'HERE_YOUR_DISCORD_WEBHOOK_URL';,
  • In your script, add the import at the top: uses Discord;,
  • Use the SendWebhook function to send your message, like this: SendWebhook('Hello');

filename: discord.pas

unit Discord;
interface

uses SysUtils, Classes;

procedure SendWebhook(Msg:WideString);

implementation

const WebhookURL = 'HERE_YOUR_DISCORD_WEBHOOK_URL';


procedure SendWebhook(Msg:WideString);
var
  PSCommand, FullCommand: WideString;
begin
  PSCommand :=
    'powershell -Command "$webhookUrl = ''' + WebhookURL + '''; ' +
    '$message = ''' + Msg + '''; ' +
    '$payload = @{ content = $message } | ConvertTo-Json -Depth 3; ' +
    'Invoke-RestMethod -Uri $webhookUrl -Method Post -ContentType ''application/json'' -Body $payload"';
	
  ShellExecuteW(0, PChar('open'), PChar('cmd.exe'),
    PChar('/C ' + PSCommand), nil, 0);
end;
function ShellExecuteW(hwnd: cardinal;
    lpOperation, lpFile, lpParameters, lpDirectory: pwidechar;
    nShowCmd: integer): cardinal;
    stdcall; external 'shell32.dll' Name 'ShellExecuteW';

end.

How it works?

Author: Velmsun