You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(!command_count&&!server_count)returnresponse.sendError('One of the following fields is required: command_count, server_count.',400);
22
+
if(command_count===undefined&&server_count===undefined)returnresponse.sendError('One of the following fields is required: command_count, server_count.',400);
23
23
24
24
constapiKey=request.headers['authorization'];
25
25
if(!apiKey)returnresponse.sendError('Authorization header is required.',401);
if(!approximate_guild_count_data)returnresponse.sendError('Could not fetch server count.',500);
40
40
41
-
if(Math.abs(server_count-approximate_guild_count_data.approximate_guild_count)>config.maxServerCountDifference)returnresponse.sendError(`The server count provided (${server_count}) is too far off from the actual server count. It cannot differ by more than ${config.maxServerCountDifference} from the actual server count, which is ${approximate_guild_count_data.approximate_guild_count}.`,400);
if(countDifference>maxDifference)returnresponse.sendError(`The server count provided (${server_count}) is too far off from the actual server count. It cannot differ by more than ${maxDifference} from the actual server count, which is ${actualGuildCount}.`,400);
Copy file name to clipboardExpand all lines: server/src/utils/bots/getApproximateGuildCount.js
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ async function getApproximateGuildCount(botId) {
5
5
if(!process.env.DISCORD_BOT_GET_APPROXIMATE_GUILD_COUNT_API_SECRET)thrownewError('DISCORD_BOT_GET_APPROXIMATE_GUILD_COUNT_API_SECRET environment variable is missing');
0 commit comments