NodeJS TypeScript Setup (#1)

* bot can login to discord

* changed node and npm to iron lts

* added typescript runnables

* more dev scripts

* readme update on scripts

* event handling skeleton

* fixed compiler target issue
This commit is contained in:
Kevin Dang
2023-12-22 11:22:16 -08:00
committed by GitHub
parent f4af329d44
commit c9dfd3671d
14 changed files with 1614 additions and 126 deletions

7
src/events/index.ts Normal file
View File

@@ -0,0 +1,7 @@
import { Event } from '../utils/index.js'
import ready from './ready.js'
// Centralized export for all events
export default [
ready
] as Event[] // staticly is better ts practice, dynamic exporting is possible

5
src/events/ready.ts Normal file
View File

@@ -0,0 +1,5 @@
import { event, Events } from '../utils/index.js'
export default event(Events.ClientReady, ({ log }, client) => {
return log(`Logged in as ${client.user.username}.`)
})