Improve voice connection checking, take advantage of optional chaining operators
This commit is contained in:
parent
df43f9eb9d
commit
398ce07bd2
11 changed files with 36 additions and 27 deletions
|
@ -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)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue