remove bad templates

This commit is contained in:
Jacob Nguyen
2024-04-01 22:49:31 -05:00
parent 95db7b299f
commit 31a92ab455
36 changed files with 106 additions and 452 deletions

2
template-ts/.env.example Normal file
View File

@@ -0,0 +1,2 @@
DISCORD_TOKEN=YOUR_DISCORD_TOKEN
NODE_ENV=<production OR development>

View File

@@ -1 +1,15 @@
# TODO
# How to use
1.) Build
```
npm run build
```
2.) Run
```
node .
```
3.) Publish
```
npm run commands:publish
```

View File

@@ -5,8 +5,10 @@
"description": "",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"start": "tsc && node ./dist/index.js"
"build": "sern build",
"start": "node .",
"install": "sern build",
"commands:publish": "sern commands publish"
},
"keywords": [
"typescript",
@@ -15,10 +17,12 @@
],
"dependencies": {
"@sern/handler": "^3.0.3",
"discord.js": "latest"
"discord.js": "latest",
"dotenv": "^16.3.1"
},
"devDependencies": {
"@types/node": "^17.0.25",
"typescript": "^5.0"
}
},
"type": "module"
}

View File

@@ -1,3 +1,4 @@
import 'dotenv/config'
import { Client, GatewayIntentBits } from 'discord.js';
import { Sern, single, makeDependencies } from '@sern/handler';
@@ -11,23 +12,21 @@ const client = new Client({
});
async function init() {
/**
* Where all of your dependencies are composed.
* '@sern/client' is usually your Discord Client.
* Use this function to access all of your dependencies.
* This is used for external event modules as well
*/
await makeDependencies(({ add }) => {
add('@sern/client', single(() => client));
});
/**
* Where all of your dependencies are composed.
* '@sern/client' is usually your Discord Client.
* Use this function to access all of your dependencies.
* This is used for external event modules as well
*/
await makeDependencies(({ add }) => {
add('@sern/client', single(() => client));
});
//View docs for all options
Sern.init({
defaultPrefix: '!', // removing defaultPrefix will shut down text commands
commands: 'dist/commands',
// events: 'dist/events', //(optional)
});
}
//View docs for all options
Sern.init({
defaultPrefix: '!', // removing defaultPrefix will shut down text commands
commands: 'dist/commands',
// events: 'dist/events', //(optional)
});
init().then(() => client.login())
await client.login()

View File

@@ -1,15 +1,3 @@
{
"compilerOptions": {
"resolveJsonModule": true,
"target": "ESNext",
"module": "CommonJS",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"esModuleInterop": true,
"noImplicitAny": true,
"strictNullChecks": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
"extends": "./.sern/tsconfig.json"
}