Skip to content

Commit 05af6f5

Browse files
authored
Merge pull request #466 from WilsontheWolf/main
fix: crash on some weird systems
2 parents b4e5d43 + 158d3fa commit 05af6f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/https.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
-- Update the Cryptid member count using HTTPS
22
local member_fallback = 24000
3-
local https = require("SMODS.https")
3+
local succ, https = pcall(require, "SMODS.https")
44
local last_update_time = 0
55
local initial = true
66
Cryptid.member_count = member_fallback
7+
if not succ then
8+
sendErrorMessage("HTTP module could not be loaded. " .. tostring(https), "Cryptid")
9+
return
10+
end
11+
712
local function apply_discord_member_count(code, body, headers)
813
if body then
914
Cryptid.member_count = string.match(body, '"approximate_member_count"%s*:%s*(%d+)')

0 commit comments

Comments
 (0)