Jump to content
Nethermane
  • Top Downloads

    No files have been downloaded yet this week.

    No files have been downloaded yet this month.

    No files have been downloaded yet this year.

    No files have been downloaded yet.

  • Topics

  • Posts

    • Welcome to the first guide on creating your first Discord bot! You will learn about code editors, some programming and JavaScript, as well as many other things. Finding your editor First of all, we have to find ourselves an editor, there are several editors that different developers prefers, and recommends. I would recommend using Visual Studio Code, it has a LARGE and GROWING community, with many extensions, plugins and customization available for free to the public.

      Please login to view content.

      - Recommended

      Please login to view content.

      Please login to view content.

      Please login to view content.

      All of these options are great, there are still others out there, which you can feel free to google for, however these are some of the most notable, and recommended editors for light code such as node.js. What is Discord.js? Discord.js is a module for Node.js, which covers nearly 100% of the official Discord API, which means you can make a bot that can do pretty much everything on your server, or only through Direct Messages. Performance, usability and consistency are key-features within Discord.js, Discord.js is also object-oriented which makes your code comprehensible and tidier. Now, Discord.js builds on top of something called Node.js, which a cross-platform, JavaScript (JS) runtime environment that executes your code outside of a browser window. Normally, JavaScript was build for browsers, to improve the user experience, Node.js basically just makes it able to act as a server. Node.js is also a very popular choice when developing a backend for some websites, therefore learning to program a Discord bot with it, grants you a lot of skills you can use down the road, if you seek to make a career out of it. Getting Started First of all, we need to install Node.js version 16.9.0 or higher. (Discord.js v14) I recommend getting the latest version there is available.

      Please login to view content.

      After the install is complete you can open CMD, and type: This will print out your node version, please double check you have the right version. After you have successfully installed node.js, we can proceed to installing Discord.js. To Install Discord.js is fairly simple, as you don't even have to visit a website! (Crazy, right?) First of all, we need a project folder, for this example we will use "C:\Discord Bot". In this folder, hold down shift and right-click, a new option should appear: Open PowerShell Window Here, when the window opens, type the following commands: The first command prepares the directory for the installation, and initializes npm, the second command installs Discord.js into the chosen directory. Each Discord.js project you make, this is what you must do to begin, Discord.js will NOT install onto your computer system, it is a by-project type thing. Creating your bot. Before we can actually begin coding, we need an API token from discord. Discord basically hands these out for free, and you don't have to worry, you just have to state your intent when creating your bot! Go to

      Please login to view content.

      , and login. After logging in, click New Application, in the top right corner. After creating your new application, go to the bot tab, and click add bot in the top right corner.  After creating the bot, reset the token for it (We have to reset it, as Discord is very strict with their security and only allows it to be viewed once, which is good practice, but can be annoying for some users, even confusing.). After successfully obtaining your bot's token, save it in a safe space, as this is the bot's authentication method. Which is basically a username and password, this is what you will connect with the bot in your script. Actual code Now, we are going to create the code that's going to run the bot! Create a new file in your directory: C:\Discord Bot, call it main.js, paste the following code into the file. Edit the last line, with your Discord Bot Token! Now the bot should be ready, open your PowerShell window within the directory, from earlier and type: Now it should be running! Invite the bot to your server To invite the bot to your server, go to the OAUTH2 tab from the Discord Developer Portal again, then go to the URL GENERATOR, tick on "bot" and allow it ADMINISTRATOR, or a permission that makes sense. Then copy the link it provides and paste it into your browser, that should open an invite window. Invite it to your server, and type !ping in any chat channel. Thanks for reading, and have fun!
    • Hello everyone and welcome to Nethermane!   This is the beginning of a new forum, one that seeks to be a place for anyone and everyone, where you can share your servers, your hosting business, a script or release something bigger! We are starting out with being focused around video games, that are customizable and have the capability to create and manage own servers. Ideas are always welcome, and I implore you to comment down below if you have a suggestion or idea on how to improve our forum, as we are very much in the early stages. Hope to see you in the trenches!
    • Modern Responsive Design. (Works neatly with phones, and other devices.) Made with Tailwind. Password confirmation with JavaScript. Live Server uptime counter. Ready for PHP Port. There are instructions and ideas/ways to implement the PHP part within the code comments. Images are provided by the source and compressed variant, background image is from Shadowlands Press Release Kit. I am too lazy to set up a server and make the PHP part, if anyone has a server running and can do the PHP part, go ahead. You are free to make any edits you want, and you are also free to extend on it, or port it to PHP. If you do port it, you can provide a Github link to me, I'll check it and update this thread.

      Please login to view content.

      There are 2 design variations, it depends on your system theme. If your phone or computer is set to dark mode, the website will detect it and make the background dark with white text.

      Please login to view content.

       <- THIS IS HTML/CSS ONLY PHP VERSION

      Please login to view content.

      I've put some more work into it, added a lot more options to the .env file, for you to customize YOUR page the way that YOU want. Registration confirmed working. Added models. Added controller for home page, as it was starting to grow. Added the .env (It was apparently included in my .gitignore, whoops.) Install Instructions 1. Make sure your PHP meets these requirements: PHP Requirements: 7.2.5+ PHP Extensions: BCMath, Ctype, Fileinfo, JSON, mbstring, OpenSSL, PDO, Tokenizer, XML, gmp, curl 2. Edit the .env file, located in your root web directory. 3. Customize it to your liking, all the important configs are at the very top, rest can be ignored. 4. Should be ready to go! GL & HF
  • Forum Statistics

    • Total Topics
      23
    • Total Posts
      25
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.