'Table[x][y] is not working, is there an alternative?
I'm trying to make a discord bot using Discordia but when I try to index a table using t[1][1] (parse[dataKey][message.guild.id]) it crashes. Can you please help? Is there another way or has anyone else experienced this? Maybe I'm just dumb.
local dataKey = message.author.id
local file = io.open("./currency.json", "r")
local parse = json.parse(file:read("*a"))
file:close()
if parse[dataKey][message.guild.id] ~= nil then
parse[dataKey][message.guild.id] = parse[dataKey][message.guild.id] + addedCurrency
else
parse[dataKey][message.guild.id] = addedCurrency
end
[solved]
Solution 1:[1]
I fixed it, I was stupid and malformatted currency.json.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | F-14 |
