mirror of
https://github.com/sern-handler/create-bot
synced 2026-06-06 01:16:53 +00:00
remove bad templates
This commit is contained in:
2
template-ts/.env.example
Normal file
2
template-ts/.env.example
Normal file
@@ -0,0 +1,2 @@
|
||||
DISCORD_TOKEN=YOUR_DISCORD_TOKEN
|
||||
NODE_ENV=<production OR development>
|
||||
@@ -1 +1,15 @@
|
||||
# TODO
|
||||
# How to use
|
||||
|
||||
1.) Build
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
2.) Run
|
||||
```
|
||||
node .
|
||||
```
|
||||
3.) Publish
|
||||
```
|
||||
npm run commands:publish
|
||||
```
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user