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

bank.transfer(fromUserId?, toUserId, quantidade)

Transfers local currency between two users. Alias of bank.transferirLocal(), but explicitly taking the source user instead of always defaulting to whoever ran the script.

bank.transfer(fromUserId?, toUserId, 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.transfer(fromUserId?, toUserId, quantidade)string?, string, number

Valor de retorno

{ ok }

Exemplo de uso

on command("pay", message, args)
  bank.transfer(nil, args._[0], tonumber(args._[1]))
  message.reply("Transfer complete! 💸")
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