Home - Olevenbaum/Discord-Bot-Template GitHub Wiki

Welcome to my Discord bot template wiki!

Before we start:

I always try to keep this wiki up to date, but there are still a lot of little mistakes. If you find any, even if it is just a misspelled word or missing punctuation, please let me know as I want this wiki to be as helpful as possible.

So, let me introduce you to my template, which I developed while working on my own Discord bot Dark-Olevenbaum. At some point I just wanted to release the concept of that bot as a template and here it is:
I seperated the general parts of the old code from the individual parts and tried to convert everything to TypeScript, because I just love type definitions. And I think it makes things easier for you, the user, who can hover over functions, variables and such to see what they do and what parameters they take (at least if you use a nice IDE).

But now let's dive into it!

Requirements

First of all, you need to meet a few requirements to use this template (which you probably already meet if you found my template). If this is your first bot you want to develop, you probably should read the following paragraphs. If this is not the case and you already know what to do, you can skip the next few paragrahps and continue to read ....

Knowledge

Basic JavaScript (or even TypeScript) knowledge is required to work with the template's code, which is written entirely in TypeScript. You will need to write custom code for various bot components, such as application commands, modals, message components and rich presence. No high level of experience is necessary, but you should be able to write code for the listed components. TypeScript knowledge is not mandatory, as JavaScript files can also be used. To rewrite or add fragments to an already existing file of the template, additional knowledge is required. Familiarity with discord.js, the library that connects your bot to Discord, is also necessary.

Software

Integrated Development Environment (IDE)

An IDE is not necessary for programming, although it is recommended. While any text editor can be used, IDEs are particularly useful when working with unfamiliar projects. They allow you to easily access information about variables and functions by hovering over them, start your bot with just one click and debug and test your code. I used Visual Studio Code initially but later switched to WebStorm by JetBrains.

Node.js (including the Node Package Manager (npm))

To run your TypeScript application, you need to install Node.js as it compiles to JavaScript, which cannot be executed locally. To check if you have the required version of Node.js installed, type node -v in any terminal. This prints the version of Node.js on your machine, if Node.js is installed. Ensure that you always keep Node.js up to date as the required version may change with upcoming updates of this template. The newest required version can be found at the dependencies section.

Additionally, install the necessary libraries and dependencies using the Node Package Manager (npm). More information on this can also be found on the dependencies section.

Dependencies

This template uses some libraries, that all need to be installed to make your bot work. Fortunately, the Node Package Manager can do most of the work for you:
Just open a terminal in the main directory of your bot and type npm i. This will install all required libraries matching the version from the package.json file. As these libraries still develop, you might need to update them frequently. You can do this by typing npm update in your terminal opened in the project.