You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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 Timer 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 Timer 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
constdmUnavailableString="I'm unable to send message to you in DM. Please make sure \"Allow direct messages from server members.\" is on in the \"Privacy & Safety\" settings in Discord settings!";
95
101
constrepositoryString="Original repository owned by DMCPlayer, no longer maintained: https://github.com/DMCPlayer/chill\nForked repository owned by original ChillBot author VanishedApps, no longer maintained: https://github.com/VanishedApps/chill\nForked repository owned by LightWayUp, still maintained: https://github.com/LightWayUp/chill";
96
102
consterrorFetchingChangelogString="Sorry, an error occured while fetching changelog. You can visit https://github.com/LightWayUp/chill/releases to see all changes.";
97
-
constinviteString="Invite ChillBot to other servers!\nhttps://discordapp.com/api/oauth2/authorize?client_id=511463919399731201&scope=bot&permissions=3136";
103
+
constinviteString=inviteURL===undefined ? undefined : `Invite ChillBot to other servers!\n${inviteURL}`;
98
104
constbotUnavailableString="Sorry, ChillBot is currently unavailable, most likely due to a new and not yet deployed update. Please check back later.";
thrownewTypeError("Incorrect type(s) for NodeModule arguments!");
822
+
}
823
+
this.name=name;
824
+
this.version=version;
825
+
this.license=license;
826
+
}
827
+
toString(){
828
+
return`${this.name}@${this.version}`;
801
829
}
802
-
this.name=name;
803
-
this.version=version;
804
-
this.license=license;
805
-
}
806
-
807
-
NodeModule.prototype.toString=function(){
808
-
return`${this.name}@${this.version}`;
809
830
}
810
831
811
832
functiongetModuleFromPath(directoryPath){
@@ -871,10 +892,7 @@ function getLicenseByRepository(repository) {
871
892
.on("error",error=>{
872
893
console.error(`An error occured while attempting to fetch license for ${repository}!\n\nFull details:\n${error}`);
873
894
}).on("end",()=>{
874
-
if(!response.complete){
875
-
returnreject(newError(`Unable to get license for ${repository}, connection was terminated while response was still not fully received!`));
876
-
}
877
-
resolve(raw.replace(/\r/gi,""));
895
+
response.complete ? resolve(raw.replace(/\r/gi,"")) : reject(newError(`Unable to get license for ${repository}, connection was terminated while response was still not fully received!`));
0 commit comments