Discord Bot Maker

Discord Bot Maker

40 ratings
Easy Money Sytem
By Papanus
[streamlabs.com]
   
Award
Favorite
Favorited
Unfavorite
What is?
Its a very simple bot. Made for this guide with the purpose to teach the noob fellows how to create a simple money system to your bot.

I did in the beta version. So the raw data wont work in the normal version.
What is Not
This is not a perfect bot that is ready to go in a server full of people. It doesn´t have all the paremeters and variable validations.

So know that if u just invite the bot to your server it shall get some bug data.
Commands
!add <mentionned member> - Adds 1000 money to the mentionned user´s wallet.
!seewallet - Shows how much money you have in your wallet.
!transfer <amount> <mentioned member> - Transfer the "amount money" from your wallet to the mentioned member´s wallet.

Event "createWallet"
The first thing we will do is a event that triggers when a member join the server.

This event will create a wallet with 1000 money inside the member´s data.
After that will send a mensage saying:

Hi <member>

Your wallet has been created





Find below the raw data:

{ "name": "createWallet", "temp": "memberJoin", "event-type": "6", "actions": [ { "member": "2", "varName": "memberJoin", "dataName": "wallet", "changeType": "0", "value": "1000", "name": "Control Member Data" }, { "channel": "4", "varName": "", "message": "Welcome ${tempVars(\"memberJoin\")}\n\nYour wallet has been created", "storage": "0", "varName2": "", "name": "Send Message" } ] }
Command "add"
Now we will create the first command.

This command will create a wallet inside the mentioned user´s data.

This command will be use to create a member´s wallet when you already have members inside the server.



This is the raw dara:

{ "name": "add", "permissions": "NONE", "restriction": "1", "actions": [ { "member": "0", "varName": "memberJoin", "dataName": "wallet", "changeType": "0", "value": "1000", "name": "Control Member Data" } ] }
Command "seewallet"
This command will store the member´s data related to the wallet in a variable. After that it will send a mensage with the value.

This "value" is the amount of money that the command author has in his wallet.





See the raw data:

{ "name": "seewallet", "permissions": "NONE", "restriction": "1", "actions": [ { "member": "1", "varName": "", "dataName": "wallet", "defaultVal": "\"error_wallet\"", "storage": "1", "varName2": "seeWallet", "name": "Store Member Data" }, { "channel": "0", "varName": "", "message": "In your wallet u have US$ ${tempVars(\"seeWallet\")}", "storage": "0", "varName2": "", "name": "Send Message" } ] }
Command "transfer"
Now we get to the last and most complicated command.

Those are the actions of the command:

Get the parameter in the command

As told before the command syntax is:

!transfer <money> <mentioned user>

When we send the command the bot will get 2 informations:

  • Amount of money
  • Mentioned user

The mentioned user is transformed in a variable by the bot. So we dont need to worry in this step about this information.

However the <money> is a information that we will have to catch and store in a variable so we can use it.



As you can see we stored the "money" in the variable "moneyTransfer"

Condition "Money" > 0

On this command we will do the codition check to see if the variable "moneyTransfer" has a value bigger than 0.

This condition should prevent people from using negative values (tkz Lasse).

If the condition is false, which means that the number is negative. It should continues the action and say the msg:

You can only transfer positive numbers

And after that "end the action"

If the condition is true. Which means that the number is greater than 0. It should jump to the action #5 and continue the code.








Condition to Check Command Author Wallet

This condition will check if the person that is transfering the money has that money in his wallet.

It will see if the value in member´s data is less than the amount in the variable "moneyTransfer"

If the condition is true. Whch mean that u dont have that money to transfer. It will continue the action and send this msg:

You can´t transfer more that you have

And after that "end the action"

If the condition is false. It will jump to the action #8 and continue the code.



Get Author Wallet

So now we need to get the autors wallet and store in a variable. So we can work with that variable.

The variable name will be "getMoneyWalletAuthor"




Subtract the money from authors wallet

So next step will be the subtraction from the command authors wallet.



Guetto action

Here is a trick part. For the bot add the value to the mentioned user wallet. We will need to transform the variable "moneyTransfer" in a number type.

The only way to do that is creating a "random number action" which the minimum and maximun range will be the same variable "moneyTransfer".(tkz omgnosound)

So we create this new variable called "moneyTranferNumber" which we will use to add the number to the user´s wallet.

moneyTransferNumber

Add "moneyTranferNumber" to the mentioned member

Now we need to add the money to the mentioned user.



Send Message

Now we can send the msg saying the information of the transaction. Something like:

Transfer

From: Author
To: Mentioned user
Amount: Money


Raw Dat

Those are all the actions u need to do to have a simple money system.

Find below the raw data.

{ "name": "transfer", "permissions": "NONE", "restriction": "1", "actions": [ { "info": "0", "infoIndex": "1", "storage": "1", "varName": "moneyTransfer", "name": "Store Command Params" }, { "storage": "1", "varName": "moneyTransfer", "comparison": "4", "value": "0", "iftrue": "2", "iftrueVal": "5", "iffalse": "0", "iffalseVal": "", "name": "Check Variable" }, { "channel": "0", "varName": "", "message": "You can only transfer positive numbers", "storage": "0", "varName2": "", "name": "Send Message" }, { "name": "End Action Sequence" }, { "member": "0", "varName": "", "dataName": "wallet", "comparison": "3", "value": "tempVars(\"moneyTransfer\")", "iftrue": "0", "iftrueVal": "", "iffalse": "2", "iffalseVal": "8", "name": "Check Member Data" }, { "channel": "0", "varName": "", "message": "You can´t transfer more that you have", "storage": "0", "varName2": "", "name": "Send Message" }, { "name": "End Action Sequence" }, { "member": "1", "varName": "", "dataName": "wallet", "defaultVal": "\"error_transfer_wallet\"", "storage": "1", "varName2": "getMoneyWalletAuthor", "name": "Store Member Data" }, { "member": "1", "varName": "", "dataName": "wallet", "changeType": "0", "value": "tempVars(\"getMoneyWalletAuthor\") - tempVars(\"moneyTransfer\")", "name": "Control Member Data" }, { "storage": "1", "varName": "moneyTranferNumber", "min": "${tempVars(\"moneyTransfer\")}", "max": "${tempVars(\"moneyTransfer\")}", "name": "Generate Random Number" }, { "member": "0", "varName": "", "dataName": "wallet", "changeType": "1", "value": "tempVars(\"moneyTranferNumber\")", "name": "Control Member Data" }, { "channel": "0", "varName": "", "message": "Transfer\n\nFrom: ${member}\nTo: ${mentionedUser}\nAmount: ${tempVars(\"moneyTransfer\")}\n", "storage": "0", "varName2": "", "name": "Send Message" } ] }
The End
I hope u guys like this guide.

Pls give me some feedback in the comments.

Thank you Lasse, omgnosound and ItzPabz for the help.

See ya!
7 Comments
SubRaZr 16 Mar, 2022 @ 4:18pm 
Great tutorial, my only issue is that is doens't seem to create a wallet when somebody joins.
#1 Flamehopper Fan 5 Sep, 2020 @ 9:07pm 
lil late but how do u put the raw code into the bot?
eza 1 Mar, 2019 @ 8:04pm 
Crimson yes there is, I have made a command quite simple, that each time they message they get 5 points or so, you will need to find or make an anti-spam command

[h1]{
"name": "Gain Currency",
"permissions": "NONE",
"restriction": "1",
"_id": "AZusj",
"actions": [
{
"member": "1",
"varName": "",
"dataName": "wallet",
"changeType": "1",
"value": "5",
"name": "Control Member Data"
}
],
"comType": "3"
}[/h1]
Crimson 17 Apr, 2018 @ 12:04pm 
Is there a way to give users a certain amount of this cash for being on the server? Longer they on the server more cash they have? At the moment it seems that everyone gets 1k and thats it.
Tjark 14 Apr, 2018 @ 8:13am 
It doesn't work
Luna 27 Jan, 2018 @ 4:23pm 
The command below is spam.
VanValdenburg 5 Oct, 2017 @ 12:49pm 
this is awesome thanks for sharing!
maybe you also want to add it on the website so even more people can find it {LINK REMOVED}