This repository was archived by the owner on Sep 30, 2020. It is now read-only.
Description since the inception of this project, we've used the chalda/DiscordBot layout for making commands, which is
exports . commands = [
'xyz'
] ;
exports . xyz = { }
However there's limtiations on this implementation
we can't use numbers in declaration names for export objects
it does not encourage clean code.
so to improve this, we'll be doing a class-based approach instead of the export object approach we usually adopted.
class CommandName {
constructor ( description , usage , adminOnly ) {
description: 'nya' ,
usage : '<ayn>' ,
adminOnly : true ;
}
async main ( ) {
await ctx . createMessage ( 'noud is cute' ) ;
}
}
exports . commands = CommandName ;
this is usually cleaner and requires less code for subcommanding compared to the exports approach
class CommandName {
constructor ( description , usage , adminOnly ) {
description: 'nya' ,
usage : '<ayn>' ,
adminOnly : true ;
}
async main ( ) {
await ctx . createMessage ( 'noud is cute' ) ;
}
async delet ( ) {
this ;
}
}
exports . commands = CommandName ; Reactions are currently unavailable
since the inception of this project, we've used the chalda/DiscordBot layout for making commands, which is
However there's limtiations on this implementation
so to improve this, we'll be doing a class-based approach instead of the export object approach we usually adopted.
this is usually cleaner and requires less code for subcommanding compared to the exports approach