db.user(user)
Alcance: usuario por servidor
Métodos
| Assinatura | Parâmetro(s) | Retorno |
|---|---|---|
| .set(chave, valor) | string, any | — |
| .get(chave) | string | any | nil |
| .has(chave) | string | bool |
| .add(chave, n) | string, number | number (novo valor) |
| .sub(chave, n) | string, number | number (novo valor) |
Exemplo de uso
on command("moedas", message, args)
let saldo = db.user(message.author).get("moedas")
message.reply("💰 Você tem " .. (saldo or 0) .. " moedas.")
end
on command("ganhar-moeda", message, args)
let novoSaldo = db.user(message.author).add("moedas", 10)
message.reply("🎉 +10 moedas! Total: " .. novoSaldo)
end