Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/copyarchive/discordjs-v13-template
[Legacy] This repo is outdated and discontinued because of DJS v14
https://github.com/copyarchive/discordjs-v13-template
bot discord discord-bot discord-js nodejs
Last synced: 9 days ago
JSON representation
[Legacy] This repo is outdated and discontinued because of DJS v14
- Host: GitHub
- URL: https://github.com/copyarchive/discordjs-v13-template
- Owner: CopyArchive
- Archived: true
- Created: 2022-02-16T11:55:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-19T12:05:05.000Z (over 2 years ago)
- Last Synced: 2024-11-05T16:17:32.551Z (9 days ago)
- Topics: bot, discord, discord-bot, discord-js, nodejs
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DiscordJS-V13-Template
Discord.js v13 Template and commands ready to use# How to use it
To use discord.js install these packages:
```sh
npm install discordjs/builders @discordjs/rest discord-api-types fs
```ether you can use the `index.js` of the repo or code it yourself:
```js
const fs = require('fs');
const { Client, Collection, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const { TOKEN } = require('./config.json')
client.commands = new Collection();// The Bot goes up
client.once('ready', () => {
console.log('Ready!');
client.user.setPresence({ activities: [{ name: 'activity text here' }], status: 'online' });
});client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;
const command = client.commands.get(interaction.commandName);if (!command) return;
try {
await command.execute(interaction, client);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
});// Logins into the bot account
client.login(TOKEN);
```to register slash commands use the `deploy-commands.js` of the repo
Repo:
Download the file you wanna include to your bot and credit me in your `credits` command like:
```
[COMMAND NAME] provided by: [Copy05](https://github.com/Copy05/)
```if you have a `package.json` file i recomend you adding:
```json
"scripts": {
"start": "node deploy-commands.js && node index.js"
},
```**NOTE: YOU REQUIRE BASIC JAVASCRIPT KNOWLEDGES TO CODE A BOT**
The peoples at Discord.js Guide have explained everything perfect: [Discord.js Guide](https://discordjs.guide/#before-you-begin)