#NoTrayIcon

Hotkey, IfWinActive, ahk_exe Discord.exe
Hotkey, $!F4, Close

Close:
WinClose

Also sets Ctrl + W as closing key (Not quit)

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#NoTrayIcon

; Global
<^q::Send !{f4}

#If WinActive("ahk_exe discord.exe")
^w::
  WinClose
return