🧮 Funções · bank · API em Inglês

bank.deposit(userId?, quantidade)

Deposits an amount of Stars into the Bank's reserve on behalf of a user. Alias of bank.depositar(), but taking the target user as a parameter instead of always defaulting to whoever ran the script.

bank.deposit(userId?, quantidade)
📝This is the same Bank API, just with English names (a 1:1 alias of the methods above, same behaviour and same rules). Use whichever style you prefer — the two can even be mixed in the same script. Here, the target user is always an explicit parameter instead of always defaulting to whoever ran the script.

Parâmetros

AssinaturaTipo(s)
bank.deposit(userId?, quantidade)string?, number

Valor de retorno

{ ok }

Exemplo de uso

on command("deposit", message, args)
  bank.deposit(nil, tonumber(args._[0]))
  message.reply("Deposited! ⭐")
end

Observações

💡 Confira os tipos esperados na tabela de Parâmetros antes de chamar: passar um tipo diferente do esperado é a causa mais comum de erro em tempo de execução.

← Ver todas as funções de bank · API em Inglês