mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
If statements must be braced
This commit is contained in:
parent
2c230ec00d
commit
40f5a7f043
1 changed files with 11 additions and 4 deletions
|
@ -106,27 +106,34 @@ export class TagsPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
},
|
},
|
||||||
|
|
||||||
timeXAgo(timeDiff) {
|
timeXAgo(timeDiff) {
|
||||||
if (typeof timeDiff !== "string")
|
if (typeof timeDiff !== "string") {
|
||||||
return 'Please pass a valid delay as a string to timeXAgo (e.g. timeXAgo("1w"))';
|
return 'Please pass a valid delay as a string to timeXAgo (e.g. timeXAgo("1w"))';
|
||||||
|
}
|
||||||
|
|
||||||
const delay = convertDelayStringToMS(timeDiff);
|
const delay = convertDelayStringToMS(timeDiff);
|
||||||
return moment(moment().valueOf() - delay);
|
return moment(moment().valueOf() - delay);
|
||||||
},
|
},
|
||||||
|
|
||||||
humanizeTime(timems) {
|
humanizeTime(timems) {
|
||||||
if (typeof timems !== "number") return moment().format("DD-MM-YYYY HH:mm");
|
if (typeof timems !== "number") {
|
||||||
|
return moment().format("DD-MM-YYYY HH:mm");
|
||||||
|
}
|
||||||
|
|
||||||
return moment(timems).format("DD-MM-YYYY HH:mm");
|
return moment(timems).format("DD-MM-YYYY HH:mm");
|
||||||
},
|
},
|
||||||
|
|
||||||
discordDateFormat(timems) {
|
discordDateFormat(timems) {
|
||||||
if (typeof timems !== "number") return moment().format("YYYY-MM-DD");
|
if (typeof timems !== "number") {
|
||||||
|
return moment().format("YYYY-MM-DD");
|
||||||
|
}
|
||||||
|
|
||||||
return moment(timems).format("YYYY-MM-DD");
|
return moment(timems).format("YYYY-MM-DD");
|
||||||
},
|
},
|
||||||
|
|
||||||
mention: input => {
|
mention: input => {
|
||||||
if (typeof input !== "string") return "";
|
if (typeof input !== "string") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
if (input.match(/^<(@#)(!&)\d+>$/)) {
|
if (input.match(/^<(@#)(!&)\d+>$/)) {
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue