This is an Advanced Command Handler that uses classes for commands.
MIT License
Bot releases are visible (Hide)
๐ 16.09.2021
๐ท๏ธ 3.1.0
๐พ 18D91CF
๐ 23
โป๏ธ 4
โ๏ธ 5
๐ฅ 1
This release brings support to Discord.js v13, arguments for functions options when setting default commands & events.
3171882 feat: Add Argument class and types. (@Ayfri)
f4b0018 feat: Add argument errors to CommandErrorType. (@Ayfri)
a6d0a35 feat: Add argument functions. (@Ayfri)
4234c15 feat: Add argument methods to CommandContext & SubCommandContext. (@Ayfri)
e286b6e feat: Add ARGUMENT_NOT_FOUND & BAD_ARGUMENT CommandErrorTypes. (@Ayfri)
bafdfef feat: Add arguments property in Command & SubCommand classes. (@Ayfri)
b72e0f7 feat: Add channelOnly
& threadOnly
tags. (@Ayfri)
ff3f837 feat: Add check
function to Tag. (@Ayfri)
b38c02b feat: Add DefaultCommandOptions, can exclude default commands. (@Ayfri)
864b758 feat: Add DefaultEventsOptions
, can exclude events. (@Ayfri)
35f118a feat: Add the getter isSkipable
to CommandArgument
class. (@Ayfri)
cb95a67 feat: Add global tags. (@Ayfri)
ee294a2 feat: Add HelpOptions
, can exclude commands, auto-delete message, use list of commands instead of list of categories. (@Ayfri)
ec60c77 feat: Add isSnowflake
util function. (@Ayfri)
8398b53 feat: Add MaybePromise
util type. (@Ayfri)
005e860, 0a69103 feat: Add MessageCreateOptions
, can explicitly exclude or not bot, explicitly send code errors or not & only when owner or not, set global tags. (@Ayfri)
ad004a6 feat: Add possibility to get messages with canary and ptb links and to get guilds with mention. (@Ayfri)
44c01ed feat: Add searching with text literal mention for getThing
function. (@Ayfri)
38b1472, 0d0389c feat: Add signature
& signatures
functions to Command
class. (@Ayfri)
9485124 feat: Add TEXT_CHANNEL
DataType for getThing
function. (@Ayfri)
ad81df2 feat: Add threads-related methods to CommandContext
class. (@Ayfri)
c66ce3e feat: Handle new error types to default messageCreate
event. (@Ayfri)
d868480 feat: Use signature(s)
methods in default help
command. (@Ayfri)
a23676b feat: Use signatures
method in argError
if no usage set. (@Ayfri)
2fb1ce8 refactor!: Rename args property to rawArgs in CommandContext, add a deprecated getter for compatibility. (@Ayfri)
ffc8d6d refactor: Rename default 'message' event to 'messageCreate'. (@Ayfri)
9b1c4e5 refactor: Rename MessageEvent class to MessageCreateEvent, set filename to same name. (@Ayfri)
05039b9 refactor: Use arguments for default help command. (@Ayfri)
8189ca2 chore: Add argumentorum parser library. (@Ayfri)
64f1443 chore: Bump minimum required Node.js version to 16.6. (@Ayfri)
c7a44d2 chore: Update discord.js to V13. (@Ayfri)
6dc37df chore: Update discord.js-better-embed to 1.3.0. (@Ayfri)
b215571 chore: Update typescript to 4.4. (@Ayfri)
Published by Ayfri about 3 years ago
๐ 08.08.2021
๐ท๏ธ 3.0.0
๐พ EF2693A
๐ 20
๐ 4
โป๏ธ 10
โ๏ธ 1
๐ฅ 2
The biggest update ever for this project is now done !
I know it's still using discord.js v12, but I will update to v13 for 3.1, don't worry, it should be quicker to come.
There is a complete guide for migrating your code here.
This version changes how commands & events are created, now you have to use classes, letting you customize more and letting the library handle more complex features and behavior without having a catchy syntax.
It now also uses XContext classes to avoid having a lot of parameters and just having 1 containing everything you need plus some useful getters/setters.
The tests are now more precises and use approximately all the features available (at least the important ones).
Thanks to everyone using this library !
You can see me on Twitch developing my projects ^o^/
5ea118b feat: Add loadEvent
function. (@Ayfri)
b1925c4 feat: Add ability to save logs in files. (@Ayfri)
ed6421c feat: Add CommandError
class. (@Ayfri)
6b9b721, 88cbc76 feat: Add default help
command. (@Ayfri)
3514515, 1cc8b1f, 9e3f745, 6b9df26, b0ed627, 84907c5, 5e1b68b, 0efe4e8 feat: Add EventContext
& CommandContext
. (@Ayfri)
3877b40 feat: Add getCommandAliasesAndNames
& findCommand
functions into CommandHandler
namespace. (@Ayfri)
c7592ca feat: Add ImageCommand
class. (@Ayfri)
fdde666 feat: Add LaunchCommandHandlerOptions
argmument in launch
event. (@Ayfri)
019a5c2 feat: Add Logger.LEVEL
property to only log certain levels. (@Ayfri)
45b72db, 8491eaf feat: Add Logging titles ignores. (@Ayfri)
d20d997 feat: Add nameAndAliases
in Command
class. (@Ayfri)
42054c0 feat: Add presence & cycling presences options when launching the CommandHandler. (@Ayfri)
48a4f4d feat: Add SlowCommand
class. (@Ayfri)
f4465d6 feat: Add SubCommands and validation methods for commands. (@Ayfri)
1816359 feat: Add unloadCommand
& unloadEvent
functions to CommandHandler. (@Ayfri)
db3654e feat: Add useful getters to AdvancedClient
. (@Ayfri)
28af5e2 feat: Add useMentionAsPrefix
property to CreateCommandHandlerOptions
. (@Ayfri)
0c00a7f feat: Improve saveJSON
typings and logging errors. (@Ayfri)
ef8d61e feat: Simplify types for events. (@Ayfri)
b319c28 feat(readme): Add information about the version of Discord.js
and the features available. (@Ayfri)
e4c45e1 fix: Fix dayjs format for Logger. (@Ayfri)
10902cc fix: Fix loading default commands showing commands name. (@Ayfri)
5ce8d4e fix: Fix logging of objects. (@Ayfri)
937347a fix: Fix typo in default ping command. (@Ayfri)
00d88cb refactor: Improve typings of getThing
. (@Ayfri)
8d12f42 refactor: Move Logger.propertyInEnum
to external function. (@Ayfri)
38dfaba refactor: Remove AdvancedClient#hasPermission
function. (@Ayfri)
e07220e refactor!: Rename Log type test
to debug
.
db81108 refactor: Rename permissionError
file to permissionUtils
. (@Ayfri)
8fcefd1 refactor!: Remove Logger.logComments
, use Logger.LogLevel
instead.
b79ecce refactor!: Update DeleteMessageOptions
interface with new Discord API.
ae07707 refactor!: Use a more approriate name for functions to use defaults.
e1a7c05 refactor: Use CommandContext
for errors functions. (@Ayfri)
610cf27 refactor: Use index.ts
files for every folders. (@Ayfri)
67b5dd3, ef57b01 chore: Use better tsconfig
. (@Ayfri)
Published by Ayfri about 3 years ago
๐ 25.07.2021
๐ท๏ธ 3.0.0-beta.4
๐พ 230740A
๐ 1
๐ 1
๐ 1
โป๏ธ 3
6B9DF26
feat: Add sendGlobalHelpMessage
& sendHelpMessage
into CommandContext
class. (@Ayfri)AAED12F
fix: Fix #85. (@Ayfri)3974C34
docs: Add links to guide. (@Ayfri)Published by Ayfri over 3 years ago
Published by Ayfri over 3 years ago
๐ 15.07.2021
๐ท๏ธ 3.0.0.beta.2
๐พ 93CA377
๐ 1
๐ 4
โป๏ธ 1
This beta fixes a lot of problems and should more stable and more usable.
88CBC76
feat(help): Add information on weather can you use the command or not in help <command>
. (@Ayfri)5E8DB3D
fix: Fix event run
method types. (@Ayfri)8964B65
fix: Fix event run
method typings for events without arguments. (@Ayfri)1C6DCCE
fix: Fix exporting types & types
directory. (@Ayfri)4F93100
fix: Support simple exports for commands & events. (@Ayfri)22A294C
refactor: Remove validation of commands in help menu in default 'help' command. (@Ayfri)Published by Ayfri over 3 years ago
Published by Ayfri over 3 years ago
๐ 07.07.2021
๐ท๏ธ 3.0.0.beta.0
๐พ FEA397F
๐ฅ 2
This is a very big release including a lot of changes, and you will need to rewrite a lot of your code to have it working on v3.
There is a guide to update your code here.
Logger.LEVEL
property to only log certain levels. (@Ayfri)Command
& SubCommand
run
method. (@Ayfri)CommandContext
. (@Ayfri)CommandError
class. (@Ayfri)help
command. (@Ayfri)ImageCommand
class. (@Ayfri)nameAndAliases
in Command
class. (@Ayfri)SlowCommand
class. (@Ayfri)SubCommands
and validation methods for commands. (@Ayfri)CommandContext
. (@fantomitechno)getCommandAliasesAndNames
& findCommand
functions into CommandHandler
namespace. (@Ayfri)LaunchCommandHandlerOptions
in launch
event. (@Ayfri)unloadCommand
& unloadEvent
functions into CommandHandler
namespace. (@Ayfri)duration
plugin for dayjs
. (@Ayfri)EventContext
. (@Ayfri)AdvancedClient
. (@Ayfri)types.ts
. (@Ayfri)dayjs
format for Logger
. (@Ayfri)getThing
& JSON
. (@Ayfri)ping
command. (@Ayfri)message
event. (@Ayfri)prettier
configuration for shorter lines. (@Ayfri)prettier
script file selection. (@Ayfri)ESLint
configuration for TSDoc
. (@Ayfri)getThing
function, fix some typos. (@Ayfri)CommandHandlerError
class into classes
folder. (@Ayfri)permissionError
file to permissionUtils
, move hasPermission
to permissionUtils
. (@Ayfri)index.ts
files for every folder. (@Ayfri)tsconfig
, add noImplicitOverride
rule. (@Ayfri)Published by Ayfri over 3 years ago
This release moves all the code for generating documentation into another repo.
It also adds the last features before v3 :)
JSONUtils
(safe save, safe load). (a71973b)codeError
. (0ea2d26)CommandHandler
namespace. (a831273)Command
class now accept different types. (1099163)IsInRightChannel
method now accepts TextChannel
as argument. (cce9113)ping
command. (0756012)package-lock
, added to .gitignore
. (24f5a65)@types/node
: 14.14.21 => 14.14.22
@typescript-eslint/eslint-plugin
: 4.14.0 => 4.14.2
@typescript-eslint/parser
: 4.14.0 => 4.14.2
eslint
: 7.18.0 => 7.19.0
eslint-plugin-jsdoc
: 31.2.2 => 31.6.0
Published by Ayfri over 3 years ago
This is a pretty big update for the chore, adding TSDoc, online documentation, Wiki & more.
Also added cooldown management & some utils.
For changes that refer to a PR, I invite you to check to documentation.
codeError
function. (2a00110b05d6cd7b8f946ea399b214887931c8d8)Published by Ayfri almost 4 years ago
This little release fixes some little issue, I should test more with each update haha.
Published by Ayfri almost 4 years ago
This release is here to fix a bug with the invalid permissions checking (the fix to #45).
Published by Ayfri almost 4 years ago
This release adds the defaults commands/events they create a new section in logs before loading normal events/commands.
It also fixes some bugs, and also add the Event class.
โ You have to use the Event class now.
Also, CommandHandler is now a namespace but you use it in the same way.
Event
class. (7fc36f1ca092104275171e347707b7a003c3a6c6)(3d9e32bfd87df444c5ccc13889d970db6f1312dc)interface
property. (4569a8f)ping
command. (39390b7)message
event. (4bbd930)setDefaultCommands
function in CommandHandler namespace. (f830c84)setDefaultEvents
function in CommandHandler namespace. (35de67e)logComments
static property in Logger
class not public. (3d9e32bfd87df444c5ccc13889d970db6f1312dc)Published by Ayfri almost 4 years ago
This is a small fix release to fix CommandHandler events.
CommandHandlerOptions
to clarify code. (094522322f4ef16fa3bf2bdd37dde3c496c49e1b)README
and package.json
. (52e66cd6c3e6a55240c1124cff2e904c2884bf55)(4c817c9ba2202fe447dfe89ef397ad626ff8d861)Published by Ayfri almost 4 years ago
This release is here to add a ton of functions/methods to help you save some habitual code you put in every bot, like getting the prefix out of a message or the missing permissions.
engineStrict
in package.json
. (6196b30ff140baf4f15bf4834bf4a551bbacc811)getMissingPermissions
method in Command
class. (d177e852cf396381c254d8a689dabdaddb54d335)getMissingTags
method in Command
class. (d2697fe00897a03288b30eed2a004a93cc878b7b)isInRightChannel
method in Command class. (6d86c98d4efe06195bed2f032354e906dd27dafc)permissionsError
function. (be4944e)version
property in CommandHandler
class. (22a9f3bcbd87c00aca751887ff1536932f9c4f1a)CommandHandler
class, now extending from EventEmitter
. (47f672c0954a94d818f5fd415cb33c1acd7351c9)(d9d0c7ff3a57ba329832a584cb2558d921b4068e)dayjs
. (739384449cf2c92527f61795d1e5f36b2cbb6282)luxon
dependency, now using dayjs
. (9222890f3b2c52e7c8cef4bf9e831fd2a803ee86)Published by Ayfri almost 4 years ago
Major update with this release is that the command handler is now written in TypeScript, so you can easily use it with typings.
This release also includes a lot of bug fixes and some changes in the command handler itself.
Note:
I prefer going to 2.0.0 instead of 1.3.0 as this version has a lot of breaking changes and this is a crucial version.
Going to TypeScript was in my head for a long time, and I struggled a bit to have all the code functional.
And I want to thank all the people who are using this library :)
BetterEmbed
class as now using module discord.js-better-embed. (e6da55a).npmignore
. (7fff8c5)argError
function. (301228e)fs.promises
+ async to have a better code. (88c8456) (6ed1e59) (deafe31)presentation.txt
. (29a498c1fce3968df067123aa0c1b9e378c81e57)Logger
class. (fc27b58) (f3f26f3)CommandOptions
to have optional properties. (1f76684)Published by Ayfri almost 4 years ago
This beta is there to fixes the last issue when using this bot.
Published by Ayfri almost 4 years ago
This release cleans up the code and brings the last fixes.
presentation.txt
. (0e5d0877547741743e1e8646b61f62fcf7a12ad3)Published by Ayfri almost 4 years ago
Just to say, I failed to put the beta tag on the version beta 2 so I have to put 2.1 (because we can't re-publish once we unpublished :/).
This beta fixes types issues and some other issues.
.npmignore
to ignore src. (7fff8c5b52b99fc4d6c9c6b757955517681b10d2)argError
function not returning the right thing. (301228e128caaf537e41b803adb5ec77e9cb3496)Published by Ayfri almost 4 years ago
This is the first public beta version for this package in TypeScript.
Surely there is a lot of bugs.
discord.js.better-embed
. (e6da55afb38bfe9d894b6119142a5a1086e50b49)Published by Ayfri about 4 years ago
This release fixes some bugs.