image

Project: Discord JS Bot

URL: https://lazytools.org/projects/js-discord-bot/

Introduction

I built a Discord Bot using Node.JS making use of the discord.js API system.

First of all I don’t normally use Node.JS so this was slightly new to me although I do work in Javascript all the time. I found the whole thing fun and familiar but also different at the same time.

Issues

First thing was the while getting used to the nuances of nodeJS to begin with. Once I got some of that done I made a start on plotting functionality.

Some of its functions are

  1. Basic channel commands
  2. Reaction roles.
  3. Dice emulator
  4. Points rewarding for users chatting in channels

Once I got the hang of all this there was the outstanding issue that this was no website - It needed a different server to be stored and run on! Not something I was taking onto account at the beginning of this project!

Solution

The solution to my problem wasn't clear to begin with. I looked into hosting platforms and all kinds of things. Now it might because I'm Scottish, but I didn’t want to part with money for hosting this.

In the end I made use of a spare Raspberry PI I had, installed Raspian OS (linux based OS for the PI) I set it up, set a fixed IP address to its config and then installed Node.js for the pi. I installed a process manager called PM2 to keep things running, this way if it reboots it will autostart the bots on it.

I set up SSH on my Mac and this allowed me to SSH from my internal network but no access from outside so nice and secure. Overall a fun project and one I definitely recommend. Links to the bot repo are at the top of the page

Tech Stack:

Need Help With Your Project?

Need help with your project? Book a free session with me to discuss your specific project requirements and how I can help you.
Color Switcher