A typescript discord.js bot to connect to Moodle Mail then send it to Discord
- Clone this repository
- After done fill config.json with your preferred ids
- Add your bot token in .env file (if you haven't bot token go to the Discord Developer Portal then create a new application)
- Start command prompt in project folder
- Run
npm install
to install all project dependencies
If you want to send only mails from certain sender you can edit the property mails in the mailer instance in Client.ts L.53
Run command npm run build
this will compile typescript in a dist
folder in project folder.
Edit the APP_ENV
property by dev
in the .env file. Then run in command prompt npm run start:dev
.
The bot will start and automatically restart if there is a change in your project folder.
Set APP_ENV
at live
, don't forget to fill the config.json
live section with your ids and other info. Then run npm run start:prod
. This will start the bot after finish to compile it.
You can also start the bot without compile it by running npm run start
.
Note for this command you can replace
node
bynodemon
to automatically restart bot on dist folder change.
Hokanosekai#0001
MIT