function registerAssistantHotkey(hotkey) {
  electron.globalShortcut.register(hotkey, () => {
    const { hotkeyBehavior } = assistantConfig;
    const isContentsVisible = mainWindow.isVisible();

    if (hotkeyBehavior === 'launch' || !isContentsVisible) {
      launchAssistant();
    }
    else if (hotkeyBehavior === 'launch+close' && isContentsVisible) {
      // Prevents change in size and position of window when opening assistant the next time
      mainWindow.restore();
      mainWindow.webContents.send('window-will-close');

      if (process.platform !== 'darwin') {
        mainWindow.close();
      }
      else {
        mainWindow.webContents.executeJavaScript(
          'document.querySelector("body").innerHTML = "";',
        );
        setTimeout(() => mainWindow.hide(), 100);
      }
    }
    else {
      requestMicToggle();
    }
  });
}
Registers global shortcut for Assistant.

@param {string} hotkey
Accelerator for assistant hotkey