diff --git a/.vscode/settings.json b/.vscode/settings.json index f8dae8e..ebdb855 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,5 +17,8 @@ "tslint.enable": false, "eslint.packageManager": "yarn", "eslint.autoFixOnSave": true, - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } } \ No newline at end of file diff --git a/components/settings.tsx b/components/settings.tsx index f5afe9d..d2f4ee4 100644 --- a/components/settings.tsx +++ b/components/settings.tsx @@ -90,6 +90,9 @@ mutation variables( necessary permissions. This enables features such as colored roles or announcement \ pings.'} + + Use | to separate roles. If a role contains |, it will not be added to the list. + Role Names Boost Status', - value: `Level ${guild.premiumTier} with ${guild.premiumSuscriptionCount} Boosts`, + value: `Level ${guild.premiumTier} with ${guild.premiumSubscriptionCount} Boosts`, inline: true }] : [] // Display information. diff --git a/server/index.ts b/server/index.ts index a84069a..5753d73 100644 --- a/server/index.ts +++ b/server/index.ts @@ -18,6 +18,7 @@ import CommandParser from './bot/client' import { MongoClient } from 'mongodb' // Import fs. import { readdir, statSync } from 'fs' +import { inspect } from 'util' // Import the bot. import { guildMemberAdd, guildMemberRemove, guildDelete } from './bot' // Get the token needed. @@ -32,7 +33,8 @@ const port = parseInt(process.env.PORT, 10) || 3000 // If port variable has been // Create a client to connect to Discord API Gateway. const client = new Client(token === 'dotenv' ? process.env.IVEBOT_TOKEN : token, { - autoreconnect: true, restMode: true + autoreconnect: true, + restMode: true }) // Connect ASAP, hopefully before the server starts. @@ -90,8 +92,8 @@ client.on('ready', () => { }) // Disconnection from Discord by error will trigger the following. -client.on('error', (err: string, id: string) => { - if (!dev) throw new Error(`Error: ${err}\nShard ID: ${id}`) +client.on('error', (err: Error, id: string) => { + console.error(`Error: ${inspect(err)}\nShard ID: ${id}`) }) // Create a database to handle certain stuff. diff --git a/yarn.lock b/yarn.lock index 1a36585..d3bdadf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1569,6 +1569,11 @@ async-each@^1.0.1: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.2.tgz#8b8a7ca2a658f927e9f307d6d1a42f4199f0f735" integrity sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg== +async-limiter@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== + async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" @@ -2726,12 +2731,12 @@ enhanced-resolve@^4.1.0: memory-fs "^0.4.0" tapable "^1.0.0" -eris@^0.10.1: - version "0.10.1" - resolved "https://registry.yarnpkg.com/eris/-/eris-0.10.1.tgz#1ecc13ff06d45edb86c344b70ec2dd2e7ef270df" - integrity sha512-POWCQ91xmG75U5V3i2bAvh/hco+HkgF+YJzerTcULe++AgKutA4l1adxqUrJ13Nxah/O+olkkQCufO+gQoawtA== +eris@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/eris/-/eris-0.11.1.tgz#b4c9ba9645c5eef9f9922c2be3c41395a3121a61" + integrity sha512-Ct32iXjESOnmklxZCEA281BQsTlAsS9xzQkbGlnvzXshCjBptWJ5h8Oxbu67ui1DirsYs0WipB8EBC9ITQ5ZQA== dependencies: - ws "^6.0.0" + ws "^7.1.2" optionalDependencies: opusscript "^0.0.4" tweetnacl "^1.0.0" @@ -7284,12 +7289,12 @@ ws@^5.2.0: dependencies: async-limiter "~1.0.0" -ws@^6.0.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" - integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== +ws@^7.1.2: + version "7.2.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.0.tgz#422eda8c02a4b5dba7744ba66eebbd84bcef0ec7" + integrity sha512-+SqNqFbwTm/0DC18KYzIsMTnEWpLwJsiasW/O17la4iDRRIO9uaHbvKiAS3AHgTiuuWerK/brj4O6MYZkei9xg== dependencies: - async-limiter "~1.0.0" + async-limiter "^1.0.0" xdg-basedir@^3.0.0: version "3.0.0"