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."
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
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
- Lookup a guide on discord bot basics (api keys / Intents / Inviting to your own server)
- Insert bot token
- npm install
- 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)
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
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
tmux a -t mywindow