I am making a discord bot which is able to manage users via a DB connection. The bot runs on the luvit interpreter and also uses the discordia library. Every time I try to create the postgres object I get this message
# luvit test.lua
Segmentation fault (core dumped)
this is the code of test.lua
local discordia = require('discordia')
local pgmoon = require('pgmoon')
local bcrypt = require('bcrypt')
local client = discordia.Client()
local dbconn = pgmoon.new({ -- this object causes the segmentation fault
host = "[redacted]",
port = "5432",
database = "[redacted",
user = "[redacted]",
password = "[REDACTED]"
})
client:on('ready', function ()
--[[local ok, err = dbconn:connect()
if not ok then
error("COULD NOT CONNECT TO POSTGRES: "..err)
end]]
print('BOT RDY')
end)
client:on('messageCreate', function (message)
print(message.channel.type)
if message.channel.type == 1 and not message.author.bot then
message:reply('hai')
end
end)
client:run('[redacted]')
I am making a discord bot which is able to manage users via a DB connection. The bot runs on the luvit interpreter and also uses the discordia library. Every time I try to create the postgres object I get this message
this is the code of test.lua