Skip to content

Commit 8634de6

Browse files
committed
Prevent crashes with no internet
1 parent 34927e5 commit 8634de6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/https.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Update the Cryptid member count using HTTPS
2-
local member_fallback = 24000
2+
local member_fallback = 27900
33
local succ, https = pcall(require, "SMODS.https")
44
local last_update_time = 0
55
local initial = true
@@ -10,7 +10,7 @@ end
1010

1111
local function apply_discord_member_count(code, body, headers)
1212
if body then
13-
Cryptid.member_count = string.match(body, '"approximate_member_count"%s*:%s*(%d+)')
13+
Cryptid.member_count = string.match(body, '"approximate_member_count"%s*:%s*(%d+)') or Cryptid.member_count
1414
end
1515
end
1616
function Cryptid.update_member_count()

0 commit comments

Comments
 (0)