Improve voice connection checking, take advantage of optional chaining operators

This commit is contained in:
Essem 2022-07-23 16:02:04 -05:00
parent df43f9eb9d
commit 398ce07bd2
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
11 changed files with 36 additions and 27 deletions

View file

@ -6,7 +6,7 @@ class RedditCommand extends ImageCommand {
params(url) {
const newArgs = this.options.text ?? this.args.filter(item => !item.includes(url)).join(" ");
return {
caption: newArgs && newArgs.trim() ? newArgs.replaceAll("\n", "").replaceAll(" ", "") : random(names)
caption: newArgs?.trim() ? newArgs.replaceAll("\n", "").replaceAll(" ", "") : random(names)
};
}