File tree Expand file tree Collapse file tree 13 files changed +81
-62
lines changed
Expand file tree Collapse file tree 13 files changed +81
-62
lines changed Original file line number Diff line number Diff line change 22
33- ** Project built on ` discord.js ` v14.**
44- ** Minimum required Node.js version: v16.11.**
5- - ** Example command setup can be found in [ ` src/commands/info/ping.js ` ] ( https://github.com/memte/ExampleBot/blob/v14/src/commands/info/ping.js ) .**
5+ - ** Example command setup can be found in [ ` src/Commands/info/ping.js ` ] ( https://github.com/memte/ExampleBot/blob/v14/src/Commands/info/ping.js ) .**
6+ - ** Don't forget to prepare a .env file in the same way as in [ ` example.env ` ] ( https://github.com/memte/ExampleBot/blob/v14/example.env ) !**
67 For more details, visit the [ Discord.js Guide] ( https://discordjs.guide/slash-commands/advanced-creation.html ) .
78
8- - ** Note: Remember to configure your settings in the [ ` config.js ` ] ( https://github.com/memte/ExampleBot/blob/v14/src/config.js ) file.**
9+ - ** Note: Remember to configure your settings in the [ ` config.js ` ] ( https://github.com/memte/ExampleBot/blob/v14/src/Base/ config.js ) file.**
910
1011## 🌟 Support the Project
1112
Original file line number Diff line number Diff line change 1+ BOT_TOKEN = " "
Original file line number Diff line number Diff line change 1- {
2- "scripts" : {
3- "start" : " node index.js"
4- },
5- "type" : " module" ,
6- "license" : " MIT" ,
7- "dependencies" : {
8- "discord.js" : " ^14.16.3" ,
9- "fs" : " ^0.0.2" ,
10- "lodash.uniqwith" : " ^4.5.0" ,
11- "moment" : " ^2.30.1"
12- },
13- "engines" : {
14- "node" : " >=16.11.0"
15- }
16- }
1+ {
2+ "scripts" : {
3+ "start" : " node src/Base/app.js"
4+ },
5+ "type" : " module" ,
6+ "license" : " MIT" ,
7+ "dependencies" : {
8+ "discord.js" : " ^14.16.3" ,
9+ "dotenv" : " ^16.4.5" ,
10+ "fs" : " ^0.0.2" ,
11+ "lodash.uniqwith" : " ^4.5.0" ,
12+ "winston" : " ^3.15.0"
13+ },
14+ "engines" : {
15+ "node" : " >=16.11.0"
16+ }
17+ }
Original file line number Diff line number Diff line change 1- import { Client , GatewayIntentBits , Partials } from 'discord.js' ;
2- const client = new Client ( {
3- intents : Object . values ( GatewayIntentBits ) ,
4- partials : Object . values ( Partials ) ,
5- shards : 'auto' ,
6- } ) ;
7- import config from './src/config.js' ;
8- import { readdirSync } from 'node:fs' ;
9-
10- const { token} = config ;
11-
12- readdirSync ( './src/utils' ) . forEach ( async file => {
13- const utilFile = await import ( `./src/utils/${ file } ` ) ;
14- const util = utilFile . default ;
15- util . execute ( client ) ;
16- } ) ;
17-
18- client . login ( token ) ;
1+ import { Client , GatewayIntentBits , Partials } from 'discord.js' ;
2+ const client = new Client ( {
3+ intents : Object . values ( GatewayIntentBits ) ,
4+ partials : Object . values ( Partials ) ,
5+ shards : 'auto' ,
6+ } ) ;
7+ import { readdirSync } from 'node:fs' ;
8+ import dotenv from "dotenv" ;
9+ dotenv . config ( ) ;
10+
11+ const token = process . env . BOT_TOKEN ;
12+
13+ readdirSync ( './src/Handlers' ) . forEach ( async file => {
14+ const utilFile = await import ( `../Handlers/${ file } ` ) ;
15+ const util = utilFile . default ;
16+ util . execute ( client ) ;
17+ } ) ;
18+
19+ client . login ( token ) ;
Original file line number Diff line number Diff line change 1+ export default {
2+ prefix : '!' ,
3+ owners : [ "Owner ID" ]
4+ } ;
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ export default {
99 client . slashDatas = [ ] ;
1010
1111 // - Handlers -
12- const commandFolders = await readdirSync ( './src/commands ' ) ;
12+ const commandFolders = await readdirSync ( './src/Commands ' ) ;
1313
1414 await Promise . all ( commandFolders . map ( async category => {
15- const commandFiles = await readdirSync ( `./src/commands /${ category } ` ) ;
15+ const commandFiles = await readdirSync ( `./src/Commands /${ category } ` ) ;
1616
1717 await Promise . all ( commandFiles . map ( async file => {
18- const commands = await import ( `../commands /${ category } /${ file } ` ) ;
18+ const commands = await import ( `../Commands /${ category } /${ file } ` ) ;
1919
2020 if ( commands ) {
2121 if ( commands . commandBase ) {
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import {readdirSync} from 'node:fs';
22
33export default {
44 async execute ( client ) {
5- const eventFiles = readdirSync ( './src/events ' ) ;
5+ const eventFiles = readdirSync ( './src/Events ' ) ;
66
77 Promise . all ( eventFiles . map ( async file => {
8- const event = await import ( `../events /${ file } ` ) . then ( x => x . default ) ;
8+ const event = await import ( `../Events /${ file } ` ) . then ( x => x . default ) ;
99
1010 if ( event . once ) {
1111 client . once ( event . name , ( ...args ) => event . execute ( ...args ) ) ;
Original file line number Diff line number Diff line change 1+ import winston from 'winston' ;
2+
3+ export default {
4+ async execute ( client ) {
5+ client . logger = winston . createLogger ( {
6+ level : "info" ,
7+ format : winston . format . combine (
8+ winston . format . timestamp ( {
9+ format : "DD-MM-YYYY HH:mm:ss" ,
10+ } ) ,
11+ winston . format . printf (
12+ ( info ) => `[${ info . timestamp } ] ${ info . level } : ${ info . message } ` ,
13+ ) ,
14+ ) ,
15+ transports : [
16+ new winston . transports . Console ( {
17+ format : winston . format . combine (
18+ winston . format . colorize ( ) ,
19+ winston . format . simple ( ) ,
20+ ) ,
21+ } ) ,
22+ ] ,
23+ } ) ;
24+ } ,
25+ } ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { Collection , Events , InteractionType } from 'discord.js' ;
2- import config from '../config.js' ;
2+ import config from '../base/ config.js' ;
33const cooldown = new Collection ( ) ;
44
55export default {
@@ -13,8 +13,8 @@ export default {
1313
1414 try {
1515 const command = client . slashCommands . get ( interaction . commandName ) ;
16- if ( command . ownerOnly && interaction . user . id !== config . owner ) {
17- return interaction . reply ( { content : 'Only my **developer ** can use this command.' , ephemeral : true } ) ;
16+ if ( command . ownerOnly && ! config . owners . includes ( interaction . user . id ) ) {
17+ return interaction . reply ( { content : 'Only my **developers ** can use this command.' , ephemeral : true } ) ;
1818 }
1919
2020 if ( command . cooldown ) {
You can’t perform that action at this time.
0 commit comments