diff --git a/package.json b/package.json index d195dcf..58a4db4 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,11 @@ "type": "string", "default": "{appname}", "description": "Custom string for the smallImageText section of the rich presence" + }, + "discord.silent": { + "type": "boolean", + "default": false, + "description": "Decides if error messages are shown to the user" } } } diff --git a/src/extension.ts b/src/extension.ts index 6098a39..be9be0f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -124,8 +124,10 @@ function initRPC(clientID: string): void { if (reconnectCounter >= config.get('reconnectThreshold')) destroyRPC(); else return; } - if (error.message.includes('ENOENT')) window.showErrorMessage('No Discord Client detected!'); - else window.showErrorMessage(`Couldn't connect to discord via rpc: ${error.message}`); + if(!config.get('silent')) { + if (error.message.includes('ENOENT')) window.showErrorMessage('No Discord Client detected!'); + else window.showErrorMessage(`Couldn't connect to discord via rpc: ${error.message}`); + } }); }