Discord bot made for l4d underworld server
- Download zip folder
- Unzip and put folder somewhere easily accesable
- Open folder in an ide(preferably vscode)
- Go to the Discord Developer Portal and create an application or use a previously made applications token in the
bot
section - Create a login.txt file and paste the applications token
- Open terminal
- Run
npm
install discord.js` in terminal and hit enter
- Open the
index.js
file - Open a terminal and type
node .
and hit enter
- When the bot is running and is online in the discord server, enter
-help
for a list of commands - Map downloads can be used by entering
-<INSERT MAP NAME HERE>
L4D underworld server downloadable maps and commands have already been generated and are in the file. If you wish to create your own commands/downloadable maps, please delete the files name mapcommands.js
file and the downloadableMaps
folder as you will now create them from scratch. To help make them, an automative script has been created and can be found in main.py
and instuctions follow:
-
You need to upload all the maps that you want the bot to be able to send out, I created a brand new google account since multiple maps will take up a lot of storage(HIGHLY recommended you create a new google account since this will take up a lot of space, 15 GB's are given for free per account)
-
You can upload the maps as either a VPK or RAR file, note that with a rar file if another user decides to download the map they will need either the program winrar or 7zip to convert it into a vpk file(I chose to do rar)
3.Once all maps are uploaded to the drive, create a link which will share all the maps(I do it by clicking on a map and holding ctrl-a
and then click on the share button. Make sure you give general access to anyone with link as a viewer.
- Open
main.py
in themapAutomation
folder and uncommentautomatefixtitlefile()
- A new file will be created named
fixtitle.py
- This file will fix create new map names for its respective map by removing all the unnecessary characters like "_" and " "
- The reason for this is to make creating map commands easier. For example if a user wanted to download the grave outdoors custom campaign, instead of them having to type
-darkblood_v2
, they could type-darkblood
- If you want to add a map and want a specific character to be removed and is unsure if its already being removed, go to the function
automatefixtitlefile
and look to see if the character you want to removed is in one of the.replace(...)
- If you do not see it being removed type
titleversionremoved6 = titleversionremoved5.replace(<INSERT CHARACTER DESIRED TO BE REMOVED HERE>)
above the lineif count == 0:
- Run the
main.py
file and wait - Once the file is being done running, a new file named
fixtitle.py
should be created
- Once
fixtitle.py
is created, uncommentfrom fixtitle import *
at the top andautomatedownloadableMapsFiles()
at the bottom - Comment out
automatefixtitlefile()
and run the file - Once the file is done running all the downloadable maps should have a file in
../downloadableMaps
- Comment out
automatedownloadableMapsFiles()
- Uncomment
automatemapcommands()
and run the file
Sources: 'https://discord.js.org/#/' 'https://www.crummy.com/software/BeautifulSoup/bs4/doc/' 'https://pypi.org/project/requests/'