Skip to content

Releases: LightWayUp/chill

2.3.0 Beta 5

03 Jan 16:52
3b9a16c
Compare
Choose a tag to compare
2.3.0 Beta 5 Pre-release
Pre-release
  • Removed remindmeMaxTimeStringLength, documentation is added right below the only usage
  • Removed licenseInfoCooldown, the number is now already calculated (1000 x 60 x 30 = 1800000) and documentation is added right below the only usage
  • Removed maxSafeMessageLength as there is no easy way to guarantee that message markdown characters won't be split into different messages. Default (1950) is used instead.
  • Bumped version to v2.3.0-beta.5
  • Added missing command variations into README.md

2.3.0 Beta 4

03 Jan 13:14
8267754
Compare
Choose a tag to compare
2.3.0 Beta 4 Pre-release
Pre-release
  • Removed unnecessary Promises nesting
  • Used ES6 class syntax for NodeModule class
  • Forbid timeout larger than or equal to 2147483648ms for "/remindme" command due to the hard limit of Node.js Timers API. See https://nodejs.org/api/timers.html#timers_settimeout_callback_delay_args
  • Forbid timeout of 0ms for "/remindme" command as it doesn't make sense to be reminded immediately... and because of the hard limit of Node.js Timers API. See https://nodejs.org/api/timers.html#timers_settimeout_callback_delay_args
  • Added handler for unhandledRejection event, errors from unhandled rejected Promises will be logged
  • Added missing command variations to help string
  • Changed program flag "restartOnFatalError" to "--restart-on-fatal-error" to be consistent with node flag syntax. See https://nodejs.org/api/cli.html#cli_options
  • Added handlers for "SIGHUP", "SIGINT", "SIGTERM", and "SIGBREAK" for clean shutdown
  • Added "inviteURL" configuration, /invite command will only work if configuration is set. This is part of the effort to gradually phase out customization on Chillbot and commit back to upstream or sibling branches
  • Added "--throw-deprecation" node flag to npm start script, as deprecated usages aren't encouraged especially for small projects like Chillbot
  • Fixed version format, there's a "." between alpha/beta/rc and the number now. See https://semver.org/#spec-item-9
  • Changed accepted format of version number for "/changelog" to reflect the change stated above
  • Replaced if... return... statements with condition shorthand syntax
  • Removed unused args at line 429 (now 434) and line 615 (now 620)
  • Bumped version to v2.3.0-beta.4

2.3.0 Beta 3

26 Dec 15:54
983257a
Compare
Choose a tag to compare
2.3.0 Beta 3 Pre-release
Pre-release
  • Function getLicense() is async now
  • node will be in the list of dependencies/tools whether its license can be fetched or not
  • npm will be in the list of dependencies/tools whether its package can be found locally or not. Reading from npm process output and fetching license from repository "npm/cli" is used as fallback
  • Added function getLicenseByRepository(), usable with repositories managed on GitHub by supplying a valid name (userOrOrganization/repositoryName). Note that it returns a Promise, so you might want to use await to wait till it resolves the raw license in certain scenarios
  • Fixed a bug related to package license file detection, where previously the filename doesn't need to match exactly but can just contain the matching pattern
  • Added additional logging when a valid package is found with getModuleFromPath() function
  • Overridden toString() function of NodeModule class, it now returns a string in the format of "packageName@version"
  • Added handler to handle timeout event from request returned by http.get(). On timeout, the request will be aborted and the generic error message will be sent
  • Dependencies and tools with "undefined" license will now have the "License" field hidden when info is sent
  • Dependencies and tools might now have "undefined" version again
  • Accept both "license" and "licence" for command execution
  • Removed progress "animation" from console when the process is restarted. This fixes the issue where the animation is separated into multiple groups if additional logging occurs when the animation hasn't finished yet. RIP animation...
  • Re-added configuration "cliProcessTimeout"
  • Fixed unexpected additional comma in configuration.json
  • Bumped version to v2.3.0-beta3

2.3.0 Beta 2

22 Dec 14:08
766abb4
Compare
Choose a tag to compare
2.3.0 Beta 2 Pre-release
Pre-release
  • Dynamically detect used libraries and tools (including npm) instead of hardcoding a list of dependencies
  • Treat npm as a normal Node module, use getModuleFromPath() to retreive details instead of reading from stdout of npm process
  • Added function getModuleFromPath() to get a NodeModule from a directory path, if the directory contains a Node module
  • Added NodeModule class with 3 properties: name, version and license
  • Added missing semicolon at line 533 (now 542)
  • Refined error logging message used when response content type is unexpected
  • Use package name of ChillBot as User Agent used when making requests
  • Library version is now never empty
  • Changed getLibraries() from returning a Map (key: library name, value: library version) to returning an Array of NodeModules
  • Changed configuration "changelogFetchTimeout" to "apiFetchTimeout", as the configuration is used for fetching both project changelog and node runtime license. Please use environment variable BOT_API_FETCH_TIMEOUT instead of BOT_CHANGELOG_FETCH_TIMEOUT
  • Removed all files dedicated to licenses, they are now read from files in dependency folders in node_modules (except for node runtime, license for node runtime is now fetched through GitHub API). This means licenses don't have to be manually maintained anymore, and should guarantee that they are up-to-date and correct
  • Removed configuration "cliProcessTimeout", it'll be added again in the future if necessary
  • Bumped version to v2.3.0-beta2

2.3.0 Beta 1

20 Dec 13:36
e1fe0b8
Compare
Choose a tag to compare
2.3.0 Beta 1 Pre-release
Pre-release
  • Use condition shorthand syntax for return statements in function getFirstMentionedUser()
  • Fixed logic error for collection length checking, collection length is never negative
  • Bumped version to v2.3.0-beta1

2.3.0 Alpha 1

19 Dec 16:25
47e48a6
Compare
Choose a tag to compare
2.3.0 Alpha 1 Pre-release
Pre-release
  • Added version number of npm to the open source libraries/tools license information. This is done by reading the stdout of npm cli process, so the feature may be unavailable when using other package managers (pnpm, for example)
  • Refactored the construction of map for open source libraries/tools license information into helper function getLibraries()
  • Added new configuration "cliProcessTimeout", used as timeout for cli processes (like git, npm) that are spawned synchronously
  • Added missing line break of logging message
  • Removed unnecessary "return" from the last statement in arrow function body
  • Removed unnecessary env option when spawning new child processes, as process.env is the default
  • Disallow 0 as value for all timeout configurations
  • Bumped version to v2.3.0-alpha1

2.2.16 Beta 1

18 Dec 13:01
2e09695
Compare
Choose a tag to compare
2.2.16 Beta 1 Pre-release
Pre-release
  • Removed explicit toString() wherever possible
  • Bumped version to v2.2.16-beta1

2.2.15

18 Dec 10:35
2d83a88
Compare
Choose a tag to compare
  • Check the permission before determining the command, store the result in variable for later use. This should make the code less repetitive or error prone
  • Disallow giving items to oneself
  • Changed unnecessary use of raw string literal (`Please mention someone!`) for "/give" error message
  • Used function bold() for library name
  • "/changelog" now accepts tag names appended with alpha, beta and rc (release candidate) versions
  • "/changelog" with more than 1 argument will not fail anymore as long as the first argument is correct
  • Fixed a bug where clientHasPermissionInChannel() only validated the first item in the array, if the argument is an array. Now it validates and filters out all items that aren't PermissionResolvables, before checking the permissions
  • Refined restart process. Now, intentional restarts initiated by using the "/restart" command no longer cause "restartOnFatalError" commandline launch argument to fail
  • Bumped version to v2.2.15

2.2.14

14 Dec 17:53
14306ca
Compare
Choose a tag to compare
  • Bumped version to v2.2.14
  • Check whether value contains blanks or is 0 length instead of whether it is fully blank for configuration "prefix" and "token"
  • Check if value is all numbers for configuration "developerIDs" and "developmentGuildIDs", IDs must be a non 0 length string consisting only 0~9
  • "use strict"
  • Added optional second parameter "nick" to function createMentionForUser(), when "nick" is true, the user mention will be created in the nickname format
  • Added a cooldown of 30 minutes to the "/opensourcelicenses" command, as the response from bot is too long. Cooldown allows chat to not be flooded even if users want to view licenses for 3rd party libraries, and it also helps reduce the server workload and the chance of hitting Discord API rate limit.
  • Added new configuration developmentGuildIDs, used to mark Discord servers as bot testing servers
  • Added constant botUnavailableString, used to notify bot users when the bot is in testing
  • Added a constant Map to map libraries to versions
  • Stop the bot from responding to commands executed outside of developmentGuilds when developmentEnvironment is set to true
  • Allow a user to be shipped with himself/herself/themselves when shipMaxAttempt is 0 or less
  • Allow reminders to never be cancelled when reminderListMaxEntries is 0 or less. Note that the server might eventually run out of memory if too many reminders are tracked
  • Allow a user to give positive infinite amount of items when giveMaxAmount is 0 or less. Note that it still doesn't accept users giving 0 or negative number of items
  • Added an utility function isSentInDevelopmentGuild() to check if a message is sent in one of the developmentGuilds
  • Renamed constant "package" to "packageJSON", as package is a future reserved word
  • Added "keywords", "homepage", "bugs", "contributors", and "repository" field
  • Fixed "author" field, which is supposed to be a person Object and not a string
  • Updated node version in "engines" field
  • Reorganized fields by the sequence they appear in NPM documentation, see https://docs.npmjs.com/files/package.json
  • Updated license information everywhere
  • Added a link to invite ChillBot to servers to README.md
  • Added icon.png as avatar for ChillBot
  • Added token-example.json as a sample for how to set bot token without environment variables
  • Several configurations, "restartTimeout" to set time to wait for between stopping old process and starting new one, "presenceName" to set the game ChillBot is currently playing, "shipMaxAttempts" to specify maximum number of times to retry when using "/ship" if two random users are the same, "reminderListMaxEntries" to specify maximum entries of reminders to keep (set a lower number to reduce memory usage), "giveMaxAmount" to specify the maximum number of items a user can give when using "/give", and "changelogFetchTimeout" to set time to wait for GitHub API
  • Added files containing license information for async-limiter, discord.js, long, ms, node, npm, prism-media, snekfetch (deprecated but still used by discord.js), tweetnacl-js, ws
  • Changed overall formatting for index.js
  • Added handler for uncaughtException event. Uncaught exceptions will now be logged, will no longer crash the bot, and will shutdown the bot cleanly (or if commandline option "restartOnFatalError" is present, restart the bot)
  • Added an Object representing default option for sending messages, if the message could potentially exceed 2000 characters
  • Added a constant message to send to channel where the command is invoked if DMs cannot be send for certain reasons
  • Added a constant message to send when an error occur whilst fetching changelog
  • Added a constant message for "/invite" command
  • Added base URL for GitHub Releases API as a constant string
  • Added permission strings as properties of const Object
  • Added some animation to display in console when the bot is restarting
  • Changed error logging, now error names and error messages will be shown besides generic logging info
  • Added additional check for if a message author is a bot user
  • Added additional check for if a message is sent in DM channel (or group DM channel). Commands in DMs are not tested and may produce undesirable effects
  • Added a helper function respondToNonCommands() for responding to users when ChillBot is mentioned outside of command executions
  • Fixed a serious bug where if your message arguments contain more than one whitespace between them, commands would fail as a result of incorrect method of dealing with argument processing. Now you can add as many whitespaces as you like
  • Added permission checking everywhere, SEND_MESSAGES is required for most commands and ADD_REACTIONS is required for "/help"
  • Tweaked logic, only after the help message has been successfully sent will ChillBot add the reaction to the original message
  • "/ship me" now accepts mixed case message too
  • Greatly improved the handling for whitespaces, now the whitespaces will remain as they were when you use "/remindme" and "/give".
  • Warn a user if DMs are unable to be sent, most likely because "Allow direct messages from server members" has been turned off
  • Added a utility function isDeveloper() to check if the message author is one of the developers listed in the configuration.json
  • Added "/restart" command to auto start ChillBot again after it shuts down by command
  • Added "/opensourcelicenses" command to display all license information for used open source tools and libraries. The items are in the following order: node, npm, direct dependencies ordered by first alphabet of the name from A-Z, indirect dependencies ordered by first alphabet of the name from A-Z. For node and direct dependencies, version numbers are also displayed. Don't wilfully overuse the command, as it will flood the chat and it is rather resource demanding for the bot!
  • Added "/changelog" command to display the changelog of the latest release of ChillBot. If a tag name is provided and the provided tag name exists, the changelog of the release corresponding to the tag name will be sent instead. Tag name must be in the format of a.b.c or va.b.c, where a, b, and c are numbers without leading 0s
  • Added "/invite" command to send the link for inviting ChillBot to other Discord servers
  • Errors are now handled more gracefully
  • Added a helper function exitProcess(), to attempt to log out the bot and terminate the process. If "shouldRestart" is true, a new detached process will be spawned
  • Added a helper function login()
  • Added a utility function clientHasPermissionInChannel() to check if the bot client has certain permission(s) in a given channel
  • Added a helper function getMatchedOriginalFromArgs() to match original message with RegExp constructed from the arguments array
  • Added a helper function handleGenerically() for handling errors
  • Added "start" command to "script" field
  • Added "engines" field and "node" version
  • Removed "Procfile", the leftover from Heroku hosting
  • Added missing 2nd argument of parseInt()
  • Log "Chilled!" only after the presence has been set, not before
  • Used concise body for all arrow functions
  • Moved bot token into token.json
  • Added configuration.json for setting prefix and other configurations
  • Moved "/remindme" time string length limit to a constant
  • Added "/stop" command to properly terminate node process, usable by bot developers
  • Added the ability to log bot token on login error. Only enabled when configuration "developmentEnvironment" is set to true.
  • Refined "/give" messages
  • Added getConfiguration() to get configurations from JSON files
  • Changed heading in README.md to "ChillBot"
  • Added "Commands" section to README.md for features overview
  • Added new configuration "developerIDs" to configuration.json
  • Removed all economy related features as discord-eco is deprecated
  • Changed package description from "Chill" to "Chill!"
  • Added license information to README.md and source files, corrected license information in other places
  • Updated discord.js from 11.2.1 to 11.4.2
  • Updated ms from 2.0.0 to 2.1.1
  • Changed test script to exit with exit code 0
  • Added .gitignore
  • Changed author in package.json to match the one listed in LICENSE
  • Used JSDoc style license block
  • Added author doc
  • Moved most constants out of functions to the top of script
  • Reimplemented "8ball" and mention-to-respond features, and fixed the bugs in previous implementation. See 43600be and a67e789 .
  • Fixed some typos and missing space in predefined responses
  • Added "repository" command
  • Chained calls as on() returns the bot client
  • Replaced deprecated setGame() with setPresence()
  • Changed all emojis in the source file and the shortname ( :emoji: ) to their JavaScript representations
  • Properly utilize Promise, added more loggings too
  • Used raw string literal syntax everywhere needed for consistency and readability
  • Updated help message
  • Removed the dangerous "eval" command
  • Tried to prevent "ship" from shipping the same user with himself/herself/themselves
  • Added checks to fail early for "remindme" command if the time string is too long, time string is invalid, or time is negative
  • Updated behavior so that the bot only keep timers for at most 300 reminders by default. Upon exceeding the limit, the oldest timer is removed, and the new one is added. Note that the oldest timer might not actually be the one with the longest timeout.
  • Added a check so that one can not give others items with negative numbers or 0
  • Added hasMentionForUser() for checking if a message contains mentions for the specific user
  • Added getRandomFromArray() utility function to get a random item from an array or an array like object
  • Added bold() and code(), this addresses the issue where manually inserting * and ` in strings is more error prone.
  • Added getFirstMentionedUser() to get the first mention in a message
  • Added isInteger(...
Read more