This is a bot is using Node.js & Discord.js
- Node.js (versions 18 or higher)
- Discord.js 14
- Discord
- Npm
- Creating a Discord Developer account and add a bot. (Read the Discord Develeoper Docs for how to set up a bot: Discord Developer Docs
Fork/clone the repository, install its dependencies:
git clone https://github.com/LinkTheCoder/Pengu.git
Add a .env to the root of the project. This is to store ID's and API Keys you will need to connect your bot to Discord.
{
CLIENT_ID=. . .
GUILD_ID=. . .
TOKEN=. . .
TENOR_KEY=. . .
YOUTUBE_KEY=. . .
}
npm start
Commands are stored in the commands
Folder.
Push updated commands to Discord:
npm run deploy
To be able to fetch videos from Youtube you will need a YouTube API key. You can read more on Youtube Developers doc Youtube Data API
You will also need to add a file to the root called lastFetchedVideo.txt
This is to store Youtube video ID's to prevent fetching same video multipel times.
To access Tenor you will as well need a API key. You can read more on Tenor Developers doc Tenor API
To use the command world-penguin-day
you will need to store user data.
Create a file with a empty array in root called user.json
The file will store the users Discord ID and add true or false to send DM.
An example of a file with data:
{
"351263861103394817": {
"receiveDMs": true
}
}
Remember to gitignore file you don't want other to access and/or upload the files to a server/database.
You can self-host locally on your PC or get a mini PC (Raspberry Pi etc).
Or you could use cloud services that specialize on discord bot hosting like Sparkedhost.