Discord Bot Maker

Discord Bot Maker

Nicht genug Bewertungen
Host your DBM bot on Oracle Cloud 24/7 for free
Von shroomjak
Note: You will need to verify your Oracle Cloud account using a credit / debit card with a temporary charge when signing up to Oracle Cloud.

Oracle Cloud Free Tier:
Compute
2 AMD based Compute VMs with 1/8 OCPU and 1 GB memory eachs
4 Arm-based Ampere A1 cores and 24 GB of memory usable as one VM or up to 4 VMs
Instances will be reclaimed when deemed idle
Block Volume - 2 volumes, 200 GB total (used for compute)
Object Storage - 10 GB
Load balancer - 1 instance with 10 Mbps
Databases - 2 DBs, 20 GB each
Monitoring - 500 million ingestion datapoints, 1 billion retrieval datapoints
Bandwidth - 10 TB egress per month, speed limited to 50 Mbps on x64 based VM, 500 Mbps * core count on ARM based VM
Public IP - 2 IPv4 for VMs, 1 IPv4 for load balancer
Notifications - 1 million delivery options per month, 1000 emails sent per month
Full, detailed list - https://www.oracle.com/cloud/free/
   
Preis verleihen
Favorisieren
Favorisiert
Entfernen
Creating an Oracle Cloud account
Go to https://signup.oraclecloud.com and begin the signup process.
Creating a virtual machine
Once you have finished creating your account go to https://cloud.oracle.com/compute/instances

On the instances page, select your compartment, then click Create Instance.

Set your compute instance name or leave it as default.

Scroll down until you see Image and shape and click Edit on the top right corner, then click Change Image.

For this tutorial we will be using Ubuntu 22.04, select Ubuntu.

Then scroll down and choose Canonical Ubuntu 22.04, then click the Select Image button at the bottom.

The shape can be left as is, the specs are sufficient for a typical Discord bot.

You may notice a warning saying:
Service limit will be reached. Upgrade your account or manage resources.
You can ignore this warning.

Scroll down to Networking, it can be left on it's default settings.

Scroll down to Add SSH Keys and download your private key and public key. Save them to your Downloads folder.
Do not lose these keys, losing them will make it impossible to connect to your virtual machine.

Scroll down to the bottom of the page and click Create.

Your virtual machine should now be created. It will boot up within a minute or two.
Connecting to your virtual machine via SSH
On your virtual machine instance page, copy your virtual machine's IP.
If you don't see the IP, refresh the page until it appears.

Next, open your command prompt.
Use the cd command to enter the folder you saved your private and public keys to, in our case we saved them to the Downloads folder.

Then type the following:
ssh ubuntu@
Then use Ctrl+Shift+V to paste your virtual machine's IP address.
Press Space then type:
-i ssh
Then press Tab to autocomplete your SSH key's file name.
If pressing Tab does not autocomplete the file name your Command Prompt is in the wrong folder.
Your command should look like this:
Then press Enter.

Type yes.

You should now be connected to your virtual machine via SSH.

Type sudo apt update && sudo apt upgrade -y and press Enter to update and upgrade your virtual machine's packages. This takes around 5 minutes.

Once the packages are done installing, you will want to install the latest version of Node.js on your virtual machine.
Copy the command below and paste it into the SSH window and press Enter to run it.
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\ sudo apt-get install -y nodejs

Node.js is now installed on your virtual machine. Next we will upload your bot files to the virtual machine using the SCP command. Make sure you leave your SSH window open.
Uploading your bot files via SCP
In Discord Bot Maker, export your bot to Node.js and save it to your Downloads folder.

Create a new Command Prompt tab / window.
Use the cd command to go to your Downloads folder.

Type:
scp -i ssh
Then press Tab to autocomplete your SSH key file name.
Press Space and type DiscordBot.zip.
Press Space and type ubuntu@
Then type your virtual machine IP address.
Then type :~ without pressing space.

Your command should look like this:
Press Enter.

Once your DiscordBot.zip file is finished uploading to the virtual machine you can close the SFTP Command Prompt tab / window.
Extracting and running your bot
Once you have uploaded DiscordBot.zip to your virtual machine using the SCP command we now have to unzip the file. Go back to your SSH window.

To unzip the file we will install the unzip package using apt.
Type sudo apt install unzip and run the command.

Once it's finished installing type sudo unzip DiscordBot.zip and run the command.

If you get a prompt asking you if you want to replace a file enter A for all.

Once your bot is finished extracting type sudo npm install to install all of Discord Bot Maker's NPM dependencies.

Now your bot is ready to run!
Type tmux to open a new tmux window. Tmux lets a command run 24/7.

In your tmux window type sudo node bot.js. Your bot should now be running!
]Your bot will continue to run even after you close the SSH window.
Updating your bot with new code
Export your new bot to Node.js and save it to the Downloads folder. Replace the old DiscordBot.zip file if you are prompted to.

Open a Command Prompt and enter cd Downloads
Type scp -i
Press Space and type ssh and press Tab to autocomplete.
Type DiscordBot.zip ubuntu@
Then type your virtual machine IP followed by :~

Your command should look like:
scp -i ssh-key-2023-07-09.key DiscordBot.zip ubuntu@129.213.193.72:~
Press enter.

Once the file is finished uploading type
ssh ubuntu@
Then type your virtual machine IP
Then type
-i ssh
Then press Tab

Your command should look like:
ssh ubuntu@129.213.193.72 -i ssh-key-2023-07-09.key
Press enter.

Once you are connected to the virtual machine type
tmux a -t 0
This will connect you to your previous tmux session.
Press CTRL+C to stop the bot.
Type
sudo unzip DiscordBot.zip
Type A to replace all the files with the new ones

Once the unzip command is finished type
sudo node bot.js

Now your bot is updated and running again. You can close your Command Prompt.
If this guide helped you please consider leaving an award!
If this guide helped you please consider leaving an award!
2 Kommentare
RandomChaos 24. Feb. 2024 um 21:45 
SSH Protocol not longer supported
mkkyy 20. Feb. 2024 um 11:17 
Still work?