Skip to content

adamhcj/pip-discordjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pip-discordjs

Node application running discord bot

Built using https://discord.js.org/

"discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend."

☁️ My own deployment on AWS

I have purchased 3 year reserved instance of t2.nano (~$80+ SGD) since my 1 year free tier has passed.
Additional recurring monthly fees paid:
USD 0.64 for 8GB-month EBS storage
USD 3.36 for 1 in-use public ipv4 address


image


📹 Preview (Please turn on sounds to hear the bot speak)

2024-08-14.19-15-06.mp4

used Google Text-to-Speech for NodeJS https://www.npmjs.com/package/node-gtts

Allows bot to speak in a channel, good for people who have muted mics / shy / in a library

image

discord bot token has been removed, insert your own token

  1. Lookup a guide on discord bot basics (api keys / Intents / Inviting to your own server)
  2. Insert bot token
  3. npm install
  4. node index.js


If you want to keep it running on a server; personally I have hosted it on the cloud in an AWS EC2 instance (t2.micro Amazon Linux 2)

getting the node files in EC2

Personally I installed git and authenticated github in my EC2 instance https://medium.com/digitalcrafts/how-to-set-up-an-ec2-instance-with-github-node-js-and-postgresql-e363cb771826

install external dependencies (if node does not already install)

get ffmpeg: https://gist.github.com/willmasters/382fe6caba44a4345a3de95d98d3aae5
yum install opus
*The above may not be necessary as it was only needed for my old discord.py script rather than the current discord.js script.

make new terminal window with tmux (so that this terminal continues even when closing ssh connection):

sudo yum install tmux
tmux new -s mywindow

view back the terminal window on the next session:

tmux a -t mywindow

About

NodeJS discord bot running in EC2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published