Hello, my name is GeneralLPrince and I decided to create a Discord to FireBase to Roblox ban bot called Pegasus that is used for game moderation from Discord, I got inspired to make this bot because of @dudeSafiyur1234 Discord-Trello-Roblox Ban bot Discord-Trello-Roblox Ban bot
I will be using repl.it and uptimerobot to host my bot and Firebase to store the data.
There are 2 commands currently but I am planning to add more commands in the future.
!ban [Username] [Reason]
You will be able to customize the prefix in the code
Setting up the bot
Go to https://repl.it/ and then create a new repl by pressing the blue square that will be found in the top right of your screen next to the Upgrade option.
After that, a UI will appear with 2 options ‘‘Create new repl’’ and a ‘‘Import from GitHub’’. We going for ‘‘Import from Github’’ once you select it, copy and paste this github.com/GeneralLPrince/Discord-Firebase-Roblox then start importing the Github.
Once you imported from Github, you will see this:
Change the language from Bash to node.js and press done then wait until your repl upgrades to Node.js and enter command to node index.js
Then go to index.js and scroll down to line 10 and edit what you must
The last step will be editing the .env file by creating a RealTime database in Firebase.
Firstly, if aren’t signed up in FireBase please do. Here is the link: https://firebase.google.com/
Once you sign up or login, create a new Firebase project and name your project to anything.
Go to Develop> Realtime Database and create a new Database and choose Start in Test mode
Congratulations, you just made a database in Firebase. Now we going back to repl.it to edit the .env file
Replace Your-Discord-Bot-Token with your bot token
Replace Your-Firebase-Server-Key with your firebase server key by going to project settings>Cloud Messaging>Server key and copy the key and paste it there
Replace YOUR-FIREBASE-DATABASE-URL with your Database URL by going to your RealTime Database>Data and then copy the link and paste it there
Once you edit the .env file you can run the project and it should work. if there were any errors or the bot didn’t work, please feel free to reply or DM in Discord. Prince#5191
How to host your bot 24/7H
Go to https://uptimerobot.com/ and login or signup.
Once you logged in your account, press + Add a new monitor then change the monitor type as HTTP(s), name your project to any name you prefer and then your URL (or IP) is https://ProjectName.username.repl.co
Once you’re done it should look like this:
And now, we finally reached the last step of this tutorial, Download the RBXM file below that contains a script and a Firebase API provided by @MXKhronos.
The script and the API should be in ServerScriptServices and remember to enable HTTPs
View the module named “Firebase Service” and edit line 31 and 32 then you’re good to go.
Discord-Firebase-Roblox.rbxm (4.1 KB)
Thanks to everyone who is viewing this tutorial, if you have any ideas or suggestions for me to add to the bot please feel free to tell me them by replying. As I said before, if there were any errors or complications please direct message me in discord Prince#5191 or make a reply here.
Credits to: @MXKhronos for the Firebase API
Thank you again,