New Applcationin the top right.
HelioBot. Now, on the left, click
Add Boton the right followed by confirming that you do want to add a bot.
OAuth2on the left navigation.
SCOPES, and scroll down and select
BOT PERMISSIONS. You could select the exact permissions that your bot needs one by one, but for this simple example it's easier to just allow the bot permission to do everything.
Authorizeand complete the reCAPTCHA to add the bot to the Discord server. If you go to your Discord now you can see the bot on the offline user list.
+ Fileand then type the name of your new file:
Create new fileto create the new file. Locate the new file, and right click on it. Select
Edit, and click
Editagain on the box that pops up. Then copy/paste this code in:
.envfile that you created, but likely you won't even be able to see your
.envfile because files that start with a dot in Linux are considered hidden files. So on the file manager, click
Settingsin the top right corner and make sure you have hidden files shown.
.envfile, right click on it, and select
Edit. Then paste the token into the file like this:
DISCORD_TOKEN=like that. Then click
Save Changesand close the tab. Saving your token separate from your code is good practice because this way you can share the code on GitHub or something like that without worrying about people getting access to your bot.
public_html/cgi-binand create a new file called
start.pyfile to be executable. On the file manager right click on
stop.pyfile and select
755permissions as well.
domain.heliohost.org/cgi-bin/start.pyand it should start the bot. You can check if the bot is running by going to Discord and seeing if HelioBot is showing up as online now. If it is, test it out by typing the command:
domain.heliohost.org/cgi-bin/stop.pyThen watch your discord and after a few minutes your bot should show up as offline. It's a good idea to keep your bot offline if you don't need it so you don't cause too much load. We recommend monitoring your load by clicking the account load button in cPanel. If you get to 80+ it might be time to shut down the bot or consider moving to a VPS where you can run your bot as much as you want and have root shell access as well.