mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(create-discord-bot): bun/deno templates (#9795)
This commit is contained in:
10
packages/create-discord-bot/template/JavaScript/.vscode/extensions.json
vendored
Normal file
10
packages/create-discord-bot/template/JavaScript/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"tamasfe.even-better-toml",
|
||||
"codezombiech.gitignore",
|
||||
"christian-kohler.npm-intellisense",
|
||||
"christian-kohler.path-intellisense"
|
||||
]
|
||||
}
|
||||
13
packages/create-discord-bot/template/JavaScript/.vscode/settings.json
vendored
Normal file
13
packages/create-discord-bot/template/JavaScript/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true,
|
||||
"source.organizeImports": false
|
||||
},
|
||||
"editor.trimAutoWhitespace": false,
|
||||
"files.insertFinalNewline": true,
|
||||
"files.eol": "\n",
|
||||
"npm.packageManager": "[REPLACE_ME]"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "[REPLACE-NAME]",
|
||||
"name": "[REPLACE_ME]",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -10,14 +10,14 @@
|
||||
"deploy": "node --require dotenv/config src/util/deploy.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@discordjs/core": "^0.6.0",
|
||||
"discord.js": "^14.11.0",
|
||||
"dotenv": "^16.0.3"
|
||||
"@discordjs/core": "^1.0.1",
|
||||
"discord.js": "^14.13.0",
|
||||
"dotenv": "^16.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.40.0",
|
||||
"eslint": "^8.47.0",
|
||||
"eslint-config-neon": "^0.1.47",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^2.8.8"
|
||||
"prettier": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import process from 'node:process';
|
||||
import { URL } from 'node:url';
|
||||
import { Client, GatewayIntentBits } from 'discord.js';
|
||||
import { loadCommands, loadEvents } from './util/loaders.js';
|
||||
@@ -14,4 +15,4 @@ const commands = await loadCommands(new URL('commands/', import.meta.url));
|
||||
registerEvents(commands, events, client);
|
||||
|
||||
// Login to the client
|
||||
void client.login();
|
||||
void client.login(process.env.DISCORD_TOKEN);
|
||||
|
||||
@@ -4,10 +4,10 @@ import { API } from '@discordjs/core/http-only';
|
||||
import { REST } from 'discord.js';
|
||||
import { loadCommands } from './loaders.js';
|
||||
|
||||
const commands = await loadCommands(new URL('commands/', import.meta.url));
|
||||
const commands = await loadCommands(new URL('../commands/', import.meta.url));
|
||||
const commandData = [...commands.values()].map((command) => command.data);
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.TOKEN);
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN);
|
||||
const api = new API(rest);
|
||||
|
||||
const result = await api.applicationCommands.bulkOverwriteGlobalCommands(process.env.APPLICATION_ID, commandData);
|
||||
|
||||
Reference in New Issue
Block a user