Discord | How to automatically start your discord Bot with a batch file (discord.js/discord.py)

Опубликовано: 05 Декабрь 2020
на канале: Reewen
16k
248

In this tutorial I'll show you how to automatically start your discord bot when you boot your computer with a batch (bat) file
This should work with both bots programmed in java script (discord.js) and python (discord.py). There is only a difference of one line in the batch file.

My help Discord:


Text Tutorial:

CREATION OF THE STARTER BATCH

1. Go to the location where the files of your discord bot are located
2. Create a text dokument (you can do that with notepad)


3. For discord.js type in this (so if you programmed in java script):



node .


3.For discord.py type in this (so if you programmed in python):



python YOURBOT.py


4. Press save as. There you can call this what you want. Just make sure that you add .bat at the end to save it as a bat file. Your file could look something like this "start.bat".


(If you don't want the terminal to be invisible skip the next steps (till you are at the autostart part) and double click your batch file to start the bot)



CREATION OF THE VBS FILE TO MAKE OUR BOT RUN IN THE BACKGROUND



5. Create another text document. In this one put in the following commands:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "TheFilePathToYourBatFileYouCreated" & Chr(34), 0
Set WshShell = Nothing


6. Press save as. Call it what you want but make sure you add ".vbs" at the end of the name to make it a vbs file (if you want the bot to start now jsut double click the file. There will be no prompt coming up if you have done it right)


AUTOSTART:

7. Press Windows + R


8. Type in the run window that will appear: "shell:startup"


9. This will open a folder. Right click in the folder, hover with your mouse over the new button and then select new shortcut


10. Put in the filepath to your .vbs file. It could look similar to this: A:\1 Archieve\5 Programmier Stuff\Discord-Bots\AutoRole\background.vbs


After you created your shortcut, you are done. Now every time you start/restart your pc the bot will start as well



Timestamps:

0:00 - Intro
0:49 - create the starting batch file
1:55 - create the vbs file (to run the bot in the background)
4:20 - making the bot automatically start with windows




Music:
Track 1: dj quads - it’s near
YouTube link:


Смотрите видео Discord | How to automatically start your discord Bot with a batch file (discord.js/discord.py) онлайн без регистрации, длительностью 05 минут 39 секунд в хорошем hd качестве. Это видео добавил пользователь Reewen 05 Декабрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 16 тысяч раз и оно понравилось 248 людям.