5.0.0
Added
- TypeScript
- ESM support
- .
- TypeScript linting
- .
CommandHandler
builder classindex.ts
for command scripts- New
/invite
command with automatic invite link generation - Automatic deployed commands sync checking
- NPM package version number to
/help
embed - Command mentions to all embeds that mention commands
- .
EventHandler
builder class- Separate folder for event handler scripts
index.ts
for event scripts- .
- Environment variable management using
dotenv
- Example
.env
- .
- Separate script for whitelist management
- Auto-generation for whitelist memory file
- Parallel promises for faster whitelist channel fetching/validating
- .
- Separate script for context management
- Automatic context generation for all whitelisted channels on startup
- Automatic context generation/deletion when whitelist is updated
- Parallel promises for faster context generation
- .
- Separate script for thinking management
- Automatic timeout for thinking storage
- .
- Separate script for activity management
- .
- New
parameters
script to store global parameters - Default colors for all embeds to use
- .
- Separate script to abstract out the logger
- .
.vscode
settings and extensions and debugger setupdevcontainer
setupnpm run commands
script to deploy commands- Node 18
.nvmrc
andengine
field inpackage.json
- .
cleverbot-free
API status to README- Development section to README
- .
- JSDoc for most public functions and fields
Changed
- Moved all source code into
./src
folder - Reorganized and renamed most files
- Updated all dependencies to latest versions and resolved all security alerts
- .
eslint
to use new flat config (eslint.config.js
instead of.eslintrc.json
)- Simplified
eslint
rules - .
/help
replies and redundant/whitelist
and/unwhitelist
replies to be ephemeral- .
token
field to be stored in environment variables instead ofconfig.json
memory file- Memory files to be stored under user ID instead of username
- .
- Whitelist storage to be more efficient
- Whitelist to store channel objects instead of channel IDs
- .
- Context storage to be more efficient
- Context to store message objects instead of strings
- Improved context generation
resumeConversations
to use context instead of fetching messages manually- Context length to be limited to 10 messages
- Context generation to not gather messages from before channel was whitelisted
- .
deployCommands
to use official client application command setter- .
- Moved helper methods to new
utils
folder - Replaced
isFromUser()
withisFromSelf()
- Replaced
doesMentionUser()
withdoesMentionSelf()
- .
- Cleaned up and significantly reduced logging output
- Logging colors to use type-safe version
- Improved logging output coloration
- .
- Improved fields in
package.json
- Project name to be lowercase (
discord-cleverbot
instead ofDiscord-Cleverbot
) - Cleaned up
.gitignore
- README to be more concise
- .
- Embeds to use EmbedBuilders instead of raw objects
- Replaced string concatenation with template literals
- User/channel/command mentions to use
discord.js
mention formatters - File path construction to use
path.join
- Discord IDs to use
Snowflake
type insetad of basic strings - All files to use camelCase
- Improved comments
- Imports to use standardized alphabetical ordering
- Promises to use
async
/await
instead of.then().catch()
- .
- Typing speed from 6 char/sec to 8 char/sec
Removed
config.json
memory files- .
- Redundant context generation when new message is received
- .
- Redundant
reset
option fordeployCommands
- .
- Unnecessary
GuildTyping
andDMTyping
GatewayIntentBits
from the client
Fixed
- Bug where setTimeout methods would crash
- Bug where emoji replacement would replace innocent underscores and colons
And much more!